Detecting http

merge-requests/18/head
Bob Mottram 2021-02-15 12:48:50 +00:00
parent 3a39dc6012
commit a85767ad58
1 changed files with 4 additions and 0 deletions

View File

@ -479,6 +479,10 @@ class PubServer(BaseHTTPRequestHandler):
if 'text/html' not in self.headers['Accept']:
return False
if self.headers['Accept'].startswith('*'):
if self.headers.get('User-Agent'):
if 'Elinks' in self.headers['User-Agent'] or \
'Lynx' in self.headers['User-Agent']:
return True
return False
if 'json' in self.headers['Accept']:
return False