Pass XML-RPC string to GzipStream instead of bytes
Since 0a04dc8fa935 the GzipStream class expect a string or a generator of strings but not bytes. Closes #14445
This commit is contained in:
@@ -181,7 +181,7 @@ class XMLProtocol:
|
||||
data = client.dumps(
|
||||
data, methodresponse=True, allow_none=True)
|
||||
if len(data) >= 1400 and 'gzip' in request.accept_encodings:
|
||||
data = GzipStream(data.encode('utf-8'), compresslevel=1)
|
||||
data = GzipStream(data, compresslevel=1)
|
||||
headers['Content-Encoding'] = 'gzip'
|
||||
return Response(
|
||||
data, content_type='text/xml', headers=headers)
|
||||
|
||||
Reference in New Issue
Block a user