From 5cb075c209d7a114856de1dec097d36110e0e204 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 9 Jan 2020 20:31:00 +0000 Subject: [PATCH] html detection --- daemon.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/daemon.py b/daemon.py index 14c9fec57..fbc73134e 100644 --- a/daemon.py +++ b/daemon.py @@ -296,11 +296,14 @@ class PubServer(BaseHTTPRequestHandler): if self.server.debug: print('ACCEPT: '+self.headers['Accept']) if 'image/' in self.headers['Accept']: - return False + if 'text/html' not in self.headers['Accept']: + return False if 'video/' in self.headers['Accept']: - return False + if 'text/html' not in self.headers['Accept']: + return False if 'audio/' in self.headers['Accept']: - return False + if 'text/html' not in self.headers['Accept']: + return False if self.headers['Accept'].startswith('*'): return False if 'json' in self.headers['Accept']: