Rev2154, Fix same origin checking in proxy mode

This commit is contained in:
shortcutme 2017-07-14 11:08:22 +02:00
parent 5a42cb92cd
commit d281f112d9
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 3 additions and 3 deletions

View file

@ -10,7 +10,7 @@ class Config(object):
def __init__(self, argv):
self.version = "0.5.6"
self.rev = 2153
self.rev = 2154
self.argv = argv
self.action = None
self.config_file = "zeronet.conf"

View file

@ -169,7 +169,7 @@ class UiRequest(object):
def getRequestUrl(self):
if self.isProxyRequest():
if self.env["PATH_INFO"].startswith("http://zero"):
if self.env["PATH_INFO"].startswith("http://zero/"):
return self.env["PATH_INFO"]
else: # Add http://zero to direct domain access
return self.env["PATH_INFO"].replace("http://", "http://zero/", 1)
@ -178,7 +178,7 @@ class UiRequest(object):
def getReferer(self):
referer = self.env.get("HTTP_REFERER")
if referer and self.isProxyRequest() and not referer.startswith("http://zero"):
if referer and self.isProxyRequest() and not referer.startswith("http://zero/"):
return referer.replace("http://", "http://zero/", 1)
else:
return referer