Skip to content

Commit

Permalink
fix: [ISSUE-73] Do not quote the colon char in URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
ndmytro committed Feb 16, 2024
1 parent 73f10b0 commit 888621d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog
## 3.6.1
* Remove unintended quoting of the column char in the API URLs

## 3.6.0
* Introduce send_each and send_each_for_multicast methods
* Add deprecation warnings to send_all and send_multicast methods, because they use the API that
Expand Down
3 changes: 2 additions & 1 deletion async_firebase/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def join_url(
"""
url = base
if parts:
url = "/".join([base.strip("/"), quote("/".join(map(lambda x: str(x).strip("/"), parts)))])
quoted_and_stripped_parts = [quote(str(part).strip("/"), safe=":") for part in parts]
url = "/".join([base.strip("/"), *quoted_and_stripped_parts])

# trailing slash can be important
if trailing_slash:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "async-firebase"
version = "3.6.0"
version = "3.6.1"
description = "Async Firebase Client - a Python asyncio client to interact with Firebase Cloud Messaging in an easy way."
license = "MIT"
authors = [
Expand Down
8 changes: 8 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,14 @@ def test_cleanup_firebase_message(firebase_message, exp_result):
False,
"/base_path/path_1?q=test",
),
(
"http://base",
["message:send"],
None,
False,
False,
"http://base/message:send",
),
),
)
def test_join_url_common_flows(base, parts, params, leading_slash, trailing_slash, exp_result):
Expand Down

0 comments on commit 888621d

Please sign in to comment.