mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Preserve query string in % to - redirects, refs #1650
This commit is contained in:
parent
d714c67d65
commit
020effe47b
2 changed files with 16 additions and 3 deletions
|
|
@ -1216,6 +1216,8 @@ class DatasetteRouter:
|
|||
# Try the same path but with "%" replaced by "-"
|
||||
# and "-" replaced with "-2D"
|
||||
new_path = request.path.replace("-", "-2D").replace("%", "-")
|
||||
if request.query_string:
|
||||
new_path += "?{}".format(request.query_string)
|
||||
await asgi_send_redirect(send, new_path)
|
||||
return
|
||||
# If URL has a trailing slash, redirect to URL without it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue