Skip to content

Commit

Permalink
πŸ’€ run redirect_to_canonical_domain on HEAD requests
Browse files Browse the repository at this point in the history
fixes #107
  • Loading branch information
Joshix-1 committed Jan 28, 2024
1 parent 8537d40 commit cdff16c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions an_website/utils/base_request_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,10 +726,13 @@ async def prepare(self) -> None:

self.handle_accept_header(self.POSSIBLE_CONTENT_TYPES)

if self.request.method == "GET":
if self.redirect_to_canonical_domain():
return
if (
self.request.method in {"GET", "HEAD"}
and self.redirect_to_canonical_domain()
):
return

if self.request.method == "GET":
if (days := Random(self.now.timestamp()).randint(0, 31337)) in {
69,
420,
Expand Down

0 comments on commit cdff16c

Please sign in to comment.