Merge pull request #327 from TheNain38/patch-1

Fix checking if Ajax request
This commit is contained in:
ZeroNet 2016-03-06 15:51:16 +01:00
commit bfdccb809c

View file

@ -188,7 +188,7 @@ class UiRequest(object):
inner_path = match.group("inner_path").lstrip("/")
if "." in inner_path and not inner_path.endswith(".html"):
return self.actionSiteMedia("/media" + path) # Only serve html files with frame
if self.env.get("HTTP_X_REQUESTED_WITH"):
if self.isAjaxRequest():
return self.error403("Ajax request not allowed to load wrapper") # No ajax allowed on wrapper
# if self.env.get("HTTP_ORIGIN") and self.env.get("HTTP_ORIGIN").strip("/") != self.env.get("HTTP_HOST", "").strip("/"):
# return self.error403("Origin does not match")