mirror of https://gitlab.com/bashrc2/epicyon
Simplify
parent
3dea14cee8
commit
a2325209fb
18
daemon.py
18
daemon.py
|
@ -489,7 +489,12 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if length > -1:
|
if length > -1:
|
||||||
self.send_header('Content-Length', str(length))
|
self.send_header('Content-Length', str(length))
|
||||||
if cookie:
|
if cookie:
|
||||||
self.send_header('Cookie', cookie)
|
cookieStr = cookie
|
||||||
|
if 'HttpOnly;' not in cookieStr:
|
||||||
|
if self.server.httpPrefix == 'https':
|
||||||
|
cookieStr += '; Secure'
|
||||||
|
cookieStr += '; HttpOnly; SameSite=Strict'
|
||||||
|
self.send_header('Cookie', cookieStr)
|
||||||
self.send_header('Host', callingDomain)
|
self.send_header('Host', callingDomain)
|
||||||
self.send_header('InstanceID', self.server.instanceId)
|
self.send_header('InstanceID', self.server.instanceId)
|
||||||
self.send_header('X-Robots-Tag', 'noindex')
|
self.send_header('X-Robots-Tag', 'noindex')
|
||||||
|
@ -564,18 +569,15 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.send_response(303)
|
self.send_response(303)
|
||||||
|
|
||||||
if cookie:
|
if cookie:
|
||||||
if not cookie.startswith('SET:'):
|
cookieStr = cookie.replace('SET:', '').strip()
|
||||||
cookieStr = cookie
|
if 'HttpOnly;' not in cookieStr:
|
||||||
if self.server.httpPrefix == 'https':
|
if self.server.httpPrefix == 'https':
|
||||||
cookieStr += '; Secure'
|
cookieStr += '; Secure'
|
||||||
cookieStr += '; HttpOnly; SameSite=Strict'
|
cookieStr += '; HttpOnly; SameSite=Strict'
|
||||||
|
if not cookie.startswith('SET:'):
|
||||||
self.send_header('Cookie', cookieStr)
|
self.send_header('Cookie', cookieStr)
|
||||||
else:
|
else:
|
||||||
setCookieStr = cookie.replace('SET:', '').strip()
|
self.send_header('Set-Cookie', cookieStr)
|
||||||
if self.server.httpPrefix == 'https':
|
|
||||||
setCookieStr += '; Secure'
|
|
||||||
setCookieStr += '; HttpOnly; SameSite=Strict'
|
|
||||||
self.send_header('Set-Cookie', setCookieStr)
|
|
||||||
self.send_header('Location', redirect)
|
self.send_header('Location', redirect)
|
||||||
self.send_header('Host', callingDomain)
|
self.send_header('Host', callingDomain)
|
||||||
self.send_header('InstanceID', self.server.instanceId)
|
self.send_header('InstanceID', self.server.instanceId)
|
||||||
|
|
Loading…
Reference in New Issue