From bbf2ed272b0cdb0b30d68e99f34fbfe14af751ed Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 15 Aug 2019 15:21:06 +0100 Subject: [PATCH] Set protocol version in class --- daemon.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/daemon.py b/daemon.py index 5949b39b..c6be94ee 100644 --- a/daemon.py +++ b/daemon.py @@ -134,8 +134,9 @@ def readFollowList(filename: str): return followlist class PubServer(BaseHTTPRequestHandler): + protocol_version = 'HTTP/1.0' + def _login_headers(self,fileFormat: str,length: int) -> None: - self.protocol_version='HTTP/1.1' self.send_response(200) self.send_header('Content-type', fileFormat) self.send_header('Content-Length', str(length)) @@ -144,7 +145,6 @@ class PubServer(BaseHTTPRequestHandler): self.end_headers() def _set_headers(self,fileFormat: str,length: int,cookie: str) -> None: - self.protocol_version='HTTP/1.1' self.send_response(200) self.send_header('Content-type', fileFormat) self.send_header('Content-Length', str(length)) @@ -155,7 +155,6 @@ class PubServer(BaseHTTPRequestHandler): self.end_headers() def _redirect_headers(self,redirect: str,cookie: str) -> None: - self.protocol_version='HTTP/1.1' self.send_response(303) self.send_header('Content-type', 'text/html') if cookie: @@ -166,7 +165,6 @@ class PubServer(BaseHTTPRequestHandler): self.end_headers() def _404(self) -> None: - self.protocol_version='HTTP/1.1' msg="

404 Not Found

".encode('utf-8') self.send_response(404) self.send_header('Content-Type', 'text/html; charset=utf-8') @@ -461,7 +459,7 @@ class PubServer(BaseHTTPRequestHandler): # if not authorized then show the login screen if self.headers.get('Accept'): - if 'text/html' in self.headers['Accept'] and self.path!='/login' and self.path!='/' and self.path!='/terms': + if 'text/html' in self.headers['Accept'] and self.path!='/login' and self.path!='/' and self.path!='/terms': if '/media/' not in self.path and \ '/sharefiles/' not in self.path and \ '/statuses/' not in self.path and \