Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hörist <philipp@hoerist.com>2023-01-01 22:48:19 +0300
committerPhilipp Hörist <philipp@hoerist.com>2023-01-01 22:48:19 +0300
commit8fc874b626a9e6c7ffaa7b92351a33a16f6602ad (patch)
tree4e49f5c543d9c1a21a3ef906349ea62c10074b4f
parentfeffa3527ddda65e3a4fcbe9f94c5a0bff2a0d7f (diff)
cfix: Don’t sniff content on unsuccessful responses
-rw-r--r--nbxmpp/http.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/nbxmpp/http.py b/nbxmpp/http.py
index 29e1c5e..e8a7148 100644
--- a/nbxmpp/http.py
+++ b/nbxmpp/http.py
@@ -407,6 +407,10 @@ class HTTPRequest(GObject.GObject):
_params: GLib.HashTable,
) -> None:
+ if self._message.get_status() not in (Soup.Status.OK,
+ Soup.Status.CREATED):
+ return
+
headers = message.get_response_headers()
encoding = headers.get_encoding()
if Soup.Encoding.CONTENT_LENGTH not in convert_soup_encoding(encoding):