Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions server/mergin/sync/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,5 +575,6 @@ def get_x_accel_uri(*url_parts):
# if the path parts_join starts with local_projects, remove it
if url.startswith(local_projects):
url = os.path.relpath(url, local_projects)
url = url.lstrip(os.path.sep)
result = os.path.join(download_accell_uri, url)
return result
6 changes: 6 additions & 0 deletions server/mergin/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,9 @@ def test_get_x_accell_uri(client):

url_parts = ()
assert get_x_accel_uri(*url_parts) == "/download"

url_parts = ("/archive", "cc900b78-a8b2-4e80-b546-74c96584bd10-v4.zip")
assert (
get_x_accel_uri(*url_parts)
== "/download/archive/cc900b78-a8b2-4e80-b546-74c96584bd10-v4.zip"
)
Loading