master
Bob Mottram 2019-08-30 18:35:57 +01:00
parent ef53f79fca
commit e3a5e074c2
1 changed files with 24 additions and 27 deletions

View File

@ -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'):