Rev860, Re-enable ajax on non-html items
This commit is contained in:
parent
03bfb64c2e
commit
f7eaf7b222
2 changed files with 7 additions and 6 deletions
|
@ -8,7 +8,7 @@ class Config(object):
|
|||
|
||||
def __init__(self, argv):
|
||||
self.version = "0.3.5"
|
||||
self.rev = 859
|
||||
self.rev = 860
|
||||
self.argv = argv
|
||||
self.action = None
|
||||
self.createParser()
|
||||
|
|
|
@ -49,7 +49,8 @@ class UiRequest(object):
|
|||
path = re.sub("^http://", "/", path) # Remove begining http for chrome extension .bit access
|
||||
|
||||
if self.env["REQUEST_METHOD"] == "OPTIONS":
|
||||
self.sendHeader()
|
||||
content_type = self.getContentType(path)
|
||||
self.sendHeader(content_type=content_type)
|
||||
return ""
|
||||
|
||||
if path == "/":
|
||||
|
@ -137,8 +138,8 @@ class UiRequest(object):
|
|||
headers.append(("Version", "HTTP/1.1"))
|
||||
headers.append(("Connection", "Keep-Alive"))
|
||||
headers.append(("Keep-Alive", "max=25, timeout=30"))
|
||||
if content_type == "application/json":
|
||||
headers.append(("Access-Control-Allow-Origin", "*")) # Allow json access only on json content
|
||||
if content_type != "text/html":
|
||||
headers.append(("Access-Control-Allow-Origin", "*")) # Allow json access on non-html files
|
||||
# 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 self.env["REQUEST_METHOD"] == "OPTIONS":
|
||||
# Allow json access
|
||||
|
|
Loading…
Reference in a new issue