Strip the token string

main
Bob Mottram 2019-11-26 17:47:56 +00:00
parent 30bfe14ccf
commit a0a158bf0b
1 changed files with 2 additions and 2 deletions

View File

@ -918,9 +918,9 @@ class PubServer(BaseHTTPRequestHandler):
# token based authenticated used by the web interface # token based authenticated used by the web interface
if self.headers.get('Cookie'): if self.headers.get('Cookie'):
if self.headers['Cookie'].startswith('epicyon='): if self.headers['Cookie'].startswith('epicyon='):
tokenStr=self.headers['Cookie'].split('=',1)[1] tokenStr=self.headers['Cookie'].split('=',1)[1].strip()
if ';' in tokenStr: if ';' in tokenStr:
tokenStr=tokenStr.split(';')[0] tokenStr=tokenStr.split(';')[0].strip()
if self.server.tokensLookup.get(tokenStr): if self.server.tokensLookup.get(tokenStr):
nickname=self.server.tokensLookup[tokenStr] nickname=self.server.tokensLookup[tokenStr]
# default to the inbox of the person # default to the inbox of the person