Skip to content

Commit

Permalink
Fix a TypeError in debug statement
Browse files Browse the repository at this point in the history
The debug statement that was added to print the redirect URLs fails in
production with the following error:

TypeError: can only concatenate str (not "ParseResult") to str

`geturl` returns the URL as a str, which we can then concatenate with
the debug statement.
  • Loading branch information
jdno committed Feb 29, 2024
1 parent 36764df commit d497def
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion homu/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ def redirect_to_canonical_host():
redirect_url = redirect_url._replace(path="/")

if request_url != redirect_url:
print("redirecting original=" + request_url + " to new=" + redirect_url) # noqa
print("redirecting original=" + request_url.geturl() + " to new=" + redirect_url.geturl()) # noqa
redirect(urllib.parse.urlunparse(redirect_url), 301)


Expand Down

0 comments on commit d497def

Please sign in to comment.