From c2cf3a0dc52c5679c580a39a8d02ad2f0cfb1275 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 31 Aug 2019 13:38:57 +0100 Subject: [PATCH] Check that accept exists --- daemon.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daemon.py b/daemon.py index 02f6df10..fdb74503 100644 --- a/daemon.py +++ b/daemon.py @@ -153,6 +153,8 @@ class PubServer(BaseHTTPRequestHandler): def _requestHTTP(self) -> bool: """Should a http response be given? """ + if not self.headers.get('Accept'): + return False if 'image/' in self.headers['Accept']: return False if self.headers['Accept'].startswith('*'):