mirror of
https://github.com/simonw/datasette.git
synced 2026-09-28 21:04:08 +02:00
Fix double-prefixed export links with base_url
Use the router-stripped route_path when building request-derived export URLs, so table, row, and query JSON/CSV links do not apply base_url twice. Keep urls.path() behavior unchanged, and add coverage for both /prefix/ exports and a /data/ base_url with a data database. Closes #2759
This commit is contained in:
parent
81a4df8a3e
commit
d657fb4315
7 changed files with 118 additions and 11 deletions
|
|
@ -837,7 +837,8 @@ def path_with_format(
|
|||
*, request=None, path=None, format=None, extra_qs=None, replace_format=None
|
||||
):
|
||||
qs = extra_qs or {}
|
||||
path = request.path if request else path
|
||||
if path is None and request:
|
||||
path = request.path
|
||||
if replace_format and path.endswith(f".{replace_format}"):
|
||||
path = path[: -(1 + len(replace_format))]
|
||||
if "." in path:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue