Add allow-origin header for media requests from same origin to fix css font support
This commit is contained in:
parent
434cfce32a
commit
5950b04c40
1 changed files with 2 additions and 1 deletions
|
@ -190,7 +190,8 @@ class UiRequest(object):
|
|||
headers.append(("Connection", "Keep-Alive"))
|
||||
headers.append(("Keep-Alive", "max=25, timeout=30"))
|
||||
headers.append(("X-Frame-Options", "SAMEORIGIN"))
|
||||
# headers.append(("Content-Security-Policy", "default-src 'self' data: 'unsafe-inline' ws://127.0.0.1:* http://127.0.0.1:* wss://tracker.webtorrent.io; sandbox allow-same-origin allow-top-navigation allow-scripts")) # Only local connections
|
||||
if content_type != "text/html" and self.env.get("HTTP_REFERER") and self.isSameOrigin(self.getReferer(), self.getRequestUrl()):
|
||||
headers.append(("Access-Control-Allow-Origin", "*")) # Allow load font files from css
|
||||
if self.env["REQUEST_METHOD"] == "OPTIONS":
|
||||
# Allow json access
|
||||
headers.append(("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Cookie"))
|
||||
|
|
Loading…
Reference in a new issue