forked from indymedia/epicyon
Simplify
parent
ef53f79fca
commit
e3a5e074c2
|
@ -1824,12 +1824,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
else:
|
||||
# directly search the binary array for the beginning
|
||||
# of an image
|
||||
mediaTypes={
|
||||
'image': ['png','jpeg','gif'],
|
||||
'video': ['mp4','webm','ogv'],
|
||||
'audio': ['mp3','ogg']
|
||||
}
|
||||
for mType,extensionList in mediaTypes.items():
|
||||
extensionList=['png','jpeg','gif','mp4','webm','ogv','mp3','ogg']
|
||||
for extension in extensionList:
|
||||
searchStr=b'Content-Type: image/png'
|
||||
if extension=='jpeg':
|
||||
|
@ -1865,6 +1860,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
fd = open(filename, 'wb')
|
||||
fd.write(postBytes[startPos:])
|
||||
fd.close()
|
||||
else:
|
||||
filename=None
|
||||
|
||||
# send the post
|
||||
if not fields.get('message'):
|
||||
|
|
Loading…
Reference in New Issue