diff options
| author | 2019-08-02 17:33:16 +0100 | |
|---|---|---|
| committer | 2019-08-02 17:33:16 +0100 | |
| commit | d093027431d019708dae940240a2e2cf902b865a (patch) | |
| tree | 42fd3775a02c20fbfb51b8b19e9fa291408fb6f8 /src | |
| parent | Show error when a fedi user isn't found (diff) | |
| signature | ||
not all HTTP responses have content-type
Diffstat (limited to 'src')
| -rw-r--r-- | src/utils/http.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils/http.py b/src/utils/http.py index 6086fb37..801e565a 100644 --- a/src/utils/http.py +++ b/src/utils/http.py @@ -90,7 +90,7 @@ def request(url: str, method: str="GET", get_params: dict={}, signal.signal(signal.SIGALRM, signal.SIG_IGN) response_headers = utils.CaseInsensitiveDict(dict(response.headers)) - content_type = response.headers["Content-Type"].split(";", 1)[0] + content_type = response.headers.get("Content-Type", "").split(";", 1)[0] def _decode_data(): return response_content.decode(response.encoding or fallback_encoding) |
