diff options
author | Philipp Hörist <philipp@hoerist.com> | 2023-01-01 22:48:19 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2023-01-01 22:48:19 +0300 |
commit | 8fc874b626a9e6c7ffaa7b92351a33a16f6602ad (patch) | |
tree | 4e49f5c543d9c1a21a3ef906349ea62c10074b4f | |
parent | feffa3527ddda65e3a4fcbe9f94c5a0bff2a0d7f (diff) |
cfix: Don’t sniff content on unsuccessful responses
-rw-r--r-- | nbxmpp/http.py | 4 |
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): |