From d497def38bf2a18784a799f8b3cc847add827c09 Mon Sep 17 00:00:00 2001 From: Jan David Date: Thu, 29 Feb 2024 10:20:10 +0100 Subject: [PATCH] Fix a TypeError in debug statement 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. --- homu/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homu/server.py b/homu/server.py index f9026a5..5ce461f 100644 --- a/homu/server.py +++ b/homu/server.py @@ -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)