Make custom pages compatible with base_url setting

Closes #1238

- base_url no longer causes custom page routing to fail
- new route_path key in request.scope storing the path that was used for routing with the base_url prefix stripped
- TestClient used by tests now avoids accidentally double processing of the base_url prefix
This commit is contained in:
Simon Willison 2021-06-05 11:59:54 -07:00 committed by GitHub
commit a634121525
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 8 deletions

View file

@ -1523,6 +1523,7 @@ def test_base_url_config(app_client_base_url_prefix, path):
and href
not in {
"https://datasette.io/",
"https://github.com/simonw/datasette",
"https://github.com/simonw/datasette/blob/main/LICENSE",
"https://github.com/simonw/datasette/blob/main/tests/fixtures.py",
"/login-as-root", # Only used for the latest.datasette.io demo