Skip to content

Commit a5e0867

Browse files
committed
do not escape {} in URL(*parts)
1 parent c2c0c94 commit a5e0867

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

py4web/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ def URL( # pylint: disable=invalid-name
897897
broken_parts.insert(1, "_" + static_version)
898898

899899
url_prefix = os.environ.get("PY4WEB_URL_PREFIX", "")
900-
url = url_prefix + prefix + "/".join(map(urllib.parse.quote, broken_parts))
900+
url = url_prefix + prefix + "/".join(urllib.parse.quote(part, safe=r":/{}") for part in broken_parts)
901901
# Signs the URL if required. Copy vars into urlvars not to modify it.
902902
urlvars = dict(vars) if vars else {}
903903
if signer:
@@ -906,7 +906,7 @@ def URL( # pylint: disable=invalid-name
906906
signer.sign(prefix + "/".join(broken_parts), urlvars)
907907
if urlvars:
908908
url += "?" + "&".join(
909-
f"{k}={urllib.parse.quote(str(v))}"
909+
f"{k}=" + urllib.parse.quote(str(v), safe=r":/{}")
910910
for k, v in urlvars.items()
911911
if v is not None
912912
)

0 commit comments

Comments
 (0)