Update server.py
This commit is contained in:
parent
d7228ccc13
commit
8a19ff1828
1 changed files with 3 additions and 4 deletions
|
@ -46,18 +46,17 @@ def relay():
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
found = False
|
found = False
|
||||||
gemraw = bytes(gemraw)
|
|
||||||
gemcontent_binary = bytearray()
|
gemcontent_binary = bytearray()
|
||||||
mtype = bytearray()
|
mtype = bytearray()
|
||||||
for i in gemraw:
|
for i in bytes(gemraw):
|
||||||
try:
|
try:
|
||||||
if not found:
|
if not found:
|
||||||
mtype += i
|
mtype += i
|
||||||
|
else:
|
||||||
|
gemcontent_binary += i
|
||||||
if "\n" in bytes(mtype).decode() and not found:
|
if "\n" in bytes(mtype).decode() and not found:
|
||||||
ok = bytes(mtype).decode().split(" ")[0][0] == "2"
|
ok = bytes(mtype).decode().split(" ")[0][0] == "2"
|
||||||
mimetype = bytes(mtype).decode().split(" ")[1].split(";")[0]
|
mimetype = bytes(mtype).decode().split(" ")[1].split(";")[0]
|
||||||
elif found:
|
|
||||||
gemcontent_binary += i
|
|
||||||
except:
|
except:
|
||||||
binary = True
|
binary = True
|
||||||
print(traceback.format_exc())
|
print(traceback.format_exc())
|
||||||
|
|
Loading…
Add table
Reference in a new issue