Skip to content

Commit

Permalink
don't fail if http_accept header is */*
Browse files Browse the repository at this point in the history
  • Loading branch information
caryoscelus committed Jul 21, 2023
1 parent f06050c commit 3330b19
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Ui/UiRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,9 @@ def actionWrapper(self, path, extra_headers=None):
if self.isWebSocketRequest():
return self.error403("WebSocket request not allowed to load wrapper") # No websocket

if "text/html" not in self.env.get("HTTP_ACCEPT", ""):
return self.error403("Invalid Accept header to load wrapper: %s" % self.env.get("HTTP_ACCEPT", ""))
http_accept = self.env.get("HTTP_ACCEPT", "")
if "text/html" not in http_accept and "*/*" not in http_accept:
return self.error403(f"Invalid Accept header to load wrapper: {http_accept}")
if "prefetch" in self.env.get("HTTP_X_MOZ", "") or "prefetch" in self.env.get("HTTP_PURPOSE", ""):
return self.error403("Prefetch not allowed to load wrapper")

Expand Down

0 comments on commit 3330b19

Please sign in to comment.