mirror of
https://github.com/HelloZeroNet/ZeroNet.git
synced 2023-12-14 04:33:03 +01:00
WebSocket requests not allowed
This commit is contained in:
parent
86bba4f0e4
commit
0a1eecee20
1 changed files with 6 additions and 1 deletions
|
@ -93,6 +93,9 @@ class UiRequest(object):
|
|||
def isProxyRequest(self):
|
||||
return self.env["PATH_INFO"].startswith("http://")
|
||||
|
||||
def isWebSocket(self):
|
||||
return self.env.get("HTTP_UPGRADE") == "websocket"
|
||||
|
||||
def isAjaxRequest(self):
|
||||
return self.env.get("HTTP_X_REQUESTED_WITH") == "XMLHttpRequest"
|
||||
|
||||
|
@ -195,7 +198,9 @@ class UiRequest(object):
|
|||
return self.actionSiteMedia("/media" + path) # Only serve html files with frame
|
||||
if self.isAjaxRequest():
|
||||
return self.error403("Ajax request not allowed to load wrapper") # No ajax allowed on wrapper
|
||||
|
||||
if self.isWebSocket():
|
||||
return self.error403("WebSocket not allowed to load wrapper") # No websocket
|
||||
|
||||
if "text/html" not in self.env["HTTP_ACCEPT"]:
|
||||
return self.error403("Invalid Accept header to load wrapper")
|
||||
if "prefetch" in self.env.get("HTTP_X_MOZ", "") or "prefetch" in self.env.get("HTTP_PURPOSE", ""):
|
||||
|
|
Loading…
Reference in a new issue