Make permissive headers more similar to mastodon instance

main
Bob Mottram 2021-08-11 18:46:37 +01:00
parent 26ad5cbd0b
commit 3c56702e1e
1 changed files with 4 additions and 2 deletions

View File

@ -686,13 +686,15 @@ class PubServer(BaseHTTPRequestHandler):
self.send_header('Content-type', fileFormat)
if length > -1:
self.send_header('Content-Length', str(length))
if cookie and not permissive:
if permissive:
return
if 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('Cookie', cookieStr)
self.send_header('Host', callingDomain)
self.send_header('Origin', self.server.domainFull)
self.send_header('InstanceID', self.server.instanceId)