Encode with gzip only if a session exists
Since 1923117e935d the server does not accept compressed content for unauthenticated request.
This commit is contained in:
@@ -142,7 +142,6 @@ class JSONUnmarshaller(object):
|
||||
class Transport(xmlrpc.client.SafeTransport):
|
||||
|
||||
accept_gzip_encoding = True
|
||||
encode_threshold = 1400 # common MTU
|
||||
|
||||
def __init__(
|
||||
self, fingerprints=None, ca_certs=None, session=None):
|
||||
@@ -251,6 +250,11 @@ class Transport(xmlrpc.client.SafeTransport):
|
||||
sock.settimeout(DEFAULT_TIMEOUT)
|
||||
return connection
|
||||
|
||||
@property
|
||||
def encode_threshold(self):
|
||||
if self.session:
|
||||
return 1400 # common MTU
|
||||
|
||||
|
||||
class ServerProxy(xmlrpc.client.ServerProxy):
|
||||
__id = 0
|
||||
|
||||
Reference in New Issue
Block a user