diff options
author | Philipp Hörist <philipp@hoerist.com> | 2023-05-21 15:08:30 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2023-05-21 15:08:30 +0300 |
commit | 8560544bc0aedee6c2a279d615c266bdf94da8fb (patch) | |
tree | 36a4739429bc5608251930ca33bbeab0c0b0172c | |
parent | 89ab76757035ad6251c2113a595829fa93e4efb9 (diff) |
cfix: Check for Soup >= 3.3.0 when using force_http1
-rw-r--r-- | nbxmpp/http.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/nbxmpp/http.py b/nbxmpp/http.py index 455fb30..e44255c 100644 --- a/nbxmpp/http.py +++ b/nbxmpp/http.py @@ -50,6 +50,7 @@ HTTP_METHODS_T = Literal[ CHUNK_SIZE = 32768 DEFAULT_USER_AGENT = f'nbxmpp/{nbxmpp.__version__}' SIGNAL_ACTIONS = GObject.SignalFlags.RUN_LAST | GObject.SignalFlags.ACTION +MIN_SOUP_3_3_0 = Soup.check_version(3, 3, 0) class HTTPLogAdapter(logging.LoggerAdapter): @@ -129,7 +130,8 @@ class HTTPRequest(GObject.GObject): self._emit_response_progress = False self._message = Soup.Message() - self._message.set_force_http1(force_http1) + if MIN_SOUP_3_3_0: + self._message.set_force_http1(force_http1) self._user_data = None self._log.info('Created') |