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:
Cédric Krier
2024-04-18 19:15:47 +02:00
parent 490a5e2c6c
commit 0e81d2d158
+5 -1
View File
@@ -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