mirror of https://gitlab.com/bashrc2/epicyon
Setting onion location
parent
76c66b16bc
commit
ad3b2b580e
16
daemon.py
16
daemon.py
|
@ -838,7 +838,10 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
print('AUTH: nickname '+nickname+' was not found in path '+self.path)
|
print('AUTH: nickname '+nickname+' was not found in path '+self.path)
|
||||||
return False
|
return False
|
||||||
if self.server.debug:
|
if self.server.debug:
|
||||||
print('AUTH: epicyon cookie authorization failed, header='+self.headers['Cookie'].replace('epicyon=','')+' tokenStr='+tokenStr+' tokens='+str(self.server.tokensLookup))
|
print('AUTH: epicyon cookie authorization failed, header='+ \
|
||||||
|
self.headers['Cookie'].replace('epicyon=','')+ \
|
||||||
|
' tokenStr='+tokenStr+' tokens='+ \
|
||||||
|
str(self.server.tokensLookup))
|
||||||
return False
|
return False
|
||||||
print('AUTH: Header cookie was not authorized')
|
print('AUTH: Header cookie was not authorized')
|
||||||
return False
|
return False
|
||||||
|
@ -4436,10 +4439,19 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.tokensLookup[self.server.tokens[loginNickname]]=loginNickname
|
self.server.tokensLookup[self.server.tokens[loginNickname]]=loginNickname
|
||||||
self.send_header('Set-Cookie', \
|
self.send_header('Set-Cookie', \
|
||||||
'epicyon='+self.server.tokens[loginNickname]+'; SameSite=Strict')
|
'epicyon='+self.server.tokens[loginNickname]+'; SameSite=Strict')
|
||||||
|
if not callingDomain.endswith('.onion') or \
|
||||||
|
not self.server.onionDomain:
|
||||||
self.send_header('Location', \
|
self.send_header('Location', \
|
||||||
self.server.httpPrefix+'://'+ \
|
self.server.httpPrefix+'://'+ \
|
||||||
self.server.domainFull+ \
|
self.server.domainFull+ \
|
||||||
'/users/'+loginNickname+'/'+self.server.defaultTimeline)
|
'/users/'+loginNickname+'/'+ \
|
||||||
|
self.server.defaultTimeline)
|
||||||
|
else:
|
||||||
|
self.send_header('Location', \
|
||||||
|
'http://'+ \
|
||||||
|
self.server.onionDomain+ \
|
||||||
|
'/users/'+loginNickname+'/'+ \
|
||||||
|
self.server.defaultTimeline)
|
||||||
self.send_header('Content-Length', '0')
|
self.send_header('Content-Length', '0')
|
||||||
self.send_header('X-Robots-Tag','noindex')
|
self.send_header('X-Robots-Tag','noindex')
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
|
|
Loading…
Reference in New Issue