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: else:
# directly search the binary array for the beginning # directly search the binary array for the beginning
# of an image # of an image
mediaTypes={ extensionList=['png','jpeg','gif','mp4','webm','ogv','mp3','ogg']
'image': ['png','jpeg','gif'],
'video': ['mp4','webm','ogv'],
'audio': ['mp3','ogg']
}
for mType,extensionList in mediaTypes.items():
for extension in extensionList: for extension in extensionList:
searchStr=b'Content-Type: image/png' searchStr=b'Content-Type: image/png'
if extension=='jpeg': if extension=='jpeg':
@ -1865,6 +1860,8 @@ class PubServer(BaseHTTPRequestHandler):
fd = open(filename, 'wb') fd = open(filename, 'wb')
fd.write(postBytes[startPos:]) fd.write(postBytes[startPos:])
fd.close() fd.close()
else:
filename=None
# send the post # send the post
if not fields.get('message'): if not fields.get('message'):