diff --git a/headphones/request.py b/headphones/request.py index 3916199a..1c6f0308 100644 --- a/headphones/request.py +++ b/headphones/request.py @@ -206,7 +206,7 @@ def server_message(response): message = None # First attempt is to 'read' the response as HTML - if response.headers.get("content-type") == "text/html": + if response.headers.get("content-type") and "text/html" in response.headers.get("content-type"): try: soup = BeautifulSoup(response.content, "html5lib") except Exception: