From 2f5c06116884e14b8d88a236099641a2a593f94e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 15 Nov 2019 12:56:07 +0000 Subject: [PATCH] Checking cookie --- daemon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon.py b/daemon.py index 7e235550..257fa464 100644 --- a/daemon.py +++ b/daemon.py @@ -778,7 +778,7 @@ class PubServer(BaseHTTPRequestHandler): def _isAuthorized(self) -> bool: # token based authenticated used by the web interface if self.headers.get('Cookie'): - if '=' in self.headers['Cookie']: + if self.headers['Cookie'].startswith('epicyon='): tokenStr=self.headers['Cookie'].split('=',1)[1] if self.server.tokensLookup.get(tokenStr): nickname=self.server.tokensLookup[tokenStr] @@ -822,7 +822,7 @@ class PubServer(BaseHTTPRequestHandler): self._logout_headers('text/html',len(msg)) self._write(msg) return - + # replace https://domain/@nick with https://domain/users/nick if self.path.startswith('/@'): self.path=self.path.replace('/@','/users/')