Rename websocket detection

This commit is contained in:
shortcutme 2017-01-08 17:26:59 +01:00
parent 612d885ad2
commit 2447279191

View file

@ -93,7 +93,7 @@ class UiRequest(object):
def isProxyRequest(self): def isProxyRequest(self):
return self.env["PATH_INFO"].startswith("http://") return self.env["PATH_INFO"].startswith("http://")
def isWebSocket(self): def isWebSocketRequest(self):
return self.env.get("HTTP_UPGRADE") == "websocket" return self.env.get("HTTP_UPGRADE") == "websocket"
def isAjaxRequest(self): def isAjaxRequest(self):
@ -198,8 +198,9 @@ class UiRequest(object):
return self.actionSiteMedia("/media" + path) # Only serve html files with frame return self.actionSiteMedia("/media" + path) # Only serve html files with frame
if self.isAjaxRequest(): if self.isAjaxRequest():
return self.error403("Ajax request not allowed to load wrapper") # No ajax allowed on wrapper 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 self.isWebSocketRequest():
return self.error403("WebSocket request not allowed to load wrapper") # No websocket
if "text/html" not in self.env["HTTP_ACCEPT"]: if "text/html" not in self.env["HTTP_ACCEPT"]:
return self.error403("Invalid Accept header to load wrapper") return self.error403("Invalid Accept header to load wrapper")