Skip to content

Commit

Permalink
Merge pull request #24 from bento-platform/fix/url-encoding
Browse files Browse the repository at this point in the history
fix: properly urlencode file names when generating URIs
  • Loading branch information
davidlougheed authored Apr 18, 2023
2 parents e573823 + d4aa6b3 commit 0f8952f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions bento_drop_box_service/backends/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import aiofiles.ospath
import os
import pathlib
import urllib.parse

from bento_lib.responses.quart_errors import quart_bad_request_error, quart_not_found_error
from typing import Tuple, TypedDict
Expand Down Expand Up @@ -63,8 +64,9 @@ async def _get_directory_tree(
"lastMetadataChange": entry_path_stat.st_ctime,
"uri": (
current_app.config["SERVICE_URL"] +
"/objects" +
_str_removeprefix_polyfill(str(entry_path), str(root_path))
"/objects/" +
urllib.parse.quote(
_str_removeprefix_polyfill(str(entry_path), str(root_path) + "/"), safe="")
),
})
})
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "bento_drop_box_service"
version = "0.11.1"
version = "0.11.2"
description = "Drop box and basic file management service for the Bento platform."
authors = ["David Lougheed <[email protected]>", "Simon Chénard <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 0f8952f

Please sign in to comment.