Encode with gzip only if a session exists

Since 1923117e935d the server does not accept compressed content for
unauthenticated request.
(grafted from 97cbe01195da6938e7f718d07e436c8a2856e3a2)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2024-04-18 19:15:47 +02:00
1 parent a1a7d957f9
commit 38b29f3bb4
1 file changed
+5 -1
+5 -1
View File
@@ -130,7 +130,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):
@@ -233,6 +232,11 @@ class Transport(xmlrpc.client.SafeTransport):
self._connection[1].sock.settimeout(DEFAULT_TIMEOUT)
return self._connection[1]
@property
def encode_threshold(self):
if self.session:
return 1400 # common MTU
class ServerProxy(xmlrpc.client.ServerProxy):
__id = 0