Redirect old % URLs to new - encoded URLs, closes #1650

Refs #1439
This commit is contained in:
Simon Willison 2022-03-07 08:01:03 -08:00
commit eeb58a09ee
2 changed files with 13 additions and 0 deletions

View file

@ -952,3 +952,9 @@ def test_no_alternate_url_json(app_client, path):
assert (
'<link rel="alternate" type="application/json+datasette"' not in response.text
)
def test_redirect_percent_encoding_to_dash_encoding(app_client):
response = app_client.get("/fivethirtyeight/twitter-ratio%2Fsenators")
assert response.status == 302
assert response.headers["location"] == "/fivethirtyeight/twitter-2Dratio-2Fsenators"