Extra access control headers

main
Bob Mottram 2021-09-26 16:54:17 +01:00
parent 8ae8f2d5a5
commit fbafaca666
1 changed files with 9 additions and 3 deletions

View File

@ -707,7 +707,7 @@ class PubServer(BaseHTTPRequestHandler):
self.send_header('Set-Cookie', 'epicyon=; SameSite=Strict')
self.send_header('Location', self._quoted_redirect(redirect))
self.send_header('Host', callingDomain)
self.send_header('InstanceID', self.server.instanceId)
self.send_header('APInstanceID', self.server.instanceId)
self.send_header('Content-Length', '0')
self.end_headers()
@ -719,7 +719,7 @@ class PubServer(BaseHTTPRequestHandler):
'max-age=84600, must-revalidate, stale-while-revalidate=3600'
self.send_header('Cache-Control', cache_control)
self.send_header('Origin', self.server.domainFull)
self.send_header('InstanceID', self.server.instanceId)
self.send_header('APInstanceID', self.server.instanceId)
self.send_header('X-Clacks-Overhead', 'GNU Natalie Nguyen')
if length > -1:
self.send_header('Content-Length', str(length))
@ -727,6 +727,12 @@ class PubServer(BaseHTTPRequestHandler):
self.send_header('Host', callingDomain)
if permissive:
self.send_header('Access-Control-Allow-Origin', '*')
acStr = \
'Server, x-goog-meta-frames, Content-Length, ' + \
'Content-Type, Range, X-Requested-With, ' + \
'If-Modified-Since, If-None-Match'
self.send_header('Access-Control-Allow-Headers', acStr)
self.send_header('Access-Control-Expose-Headers', acStr)
return
if cookie:
cookieStr = cookie
@ -820,7 +826,7 @@ class PubServer(BaseHTTPRequestHandler):
self.send_header('Set-Cookie', cookieStr)
self.send_header('Location', self._quoted_redirect(redirect))
self.send_header('Host', callingDomain)
self.send_header('InstanceID', self.server.instanceId)
self.send_header('APInstanceID', self.server.instanceId)
self.send_header('Content-Length', '0')
self.end_headers()