Don't encode byte responses

This commit is contained in:
shortcutme 2019-10-06 03:10:43 +02:00
parent 917a2e59ce
commit 73e0aa17c4
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -340,7 +340,13 @@ def encodeResponse(func):
back = func(*args, **kwargs)
if "__next__" in dir(back):
for part in back:
if type(part) == bytes:
yield part
else:
yield part.encode()
else:
if type(back) == bytes:
yield back
else:
yield back.encode()