From e967301ab455d385d7a22324c027a3d955f5a1a9 Mon Sep 17 00:00:00 2001 From: James Jefferies Date: Thu, 11 Sep 2025 22:16:28 +0100 Subject: [PATCH] Now reformatted with black --- datasette/app.py | 2 +- tests/test_custom_pages.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/datasette/app.py b/datasette/app.py index c940f6dc..b3292f60 100644 --- a/datasette/app.py +++ b/datasette/app.py @@ -1811,7 +1811,7 @@ class DatasetteRouter: # If you redirect with a // at the beginning, you end up with an open redirect, so # https://my.site//foo/ - will redirect to https://foo - path = re.sub(rb'^/+', b'/', path) + path = re.sub(rb"^/+", b"/", path) if request.scope["query_string"]: path += b"?" + request.scope["query_string"] diff --git a/tests/test_custom_pages.py b/tests/test_custom_pages.py index 48b27e7b..ccc139ce 100644 --- a/tests/test_custom_pages.py +++ b/tests/test_custom_pages.py @@ -98,7 +98,8 @@ def test_custom_route_pattern_404(custom_pages_client): assert "

Error 404

" in response.text assert ">Oh no