Skip to content

Commit 03e1f04

Browse files
authored
fix: [ISSUE-73] Do not quote the colon char in URLs (#74)
1 parent 73f10b0 commit 03e1f04

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Changelog
2+
## 3.6.1
3+
* Remove unintended quoting of the column char in the API URLs
4+
25
## 3.6.0
36
* Introduce send_each and send_each_for_multicast methods
47
* Add deprecation warnings to send_all and send_multicast methods, because they use the API that

async_firebase/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def join_url(
4646
"""
4747
url = base
4848
if parts:
49-
url = "/".join([base.strip("/"), quote("/".join(map(lambda x: str(x).strip("/"), parts)))])
49+
quoted_and_stripped_parts = [quote(str(part).strip("/"), safe=":") for part in parts]
50+
url = "/".join([base.strip("/"), *quoted_and_stripped_parts])
5051

5152
# trailing slash can be important
5253
if trailing_slash:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "async-firebase"
3-
version = "3.6.0"
3+
version = "3.6.1"
44
description = "Async Firebase Client - a Python asyncio client to interact with Firebase Cloud Messaging in an easy way."
55
license = "MIT"
66
authors = [

tests/test_utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,14 @@ def test_cleanup_firebase_message(firebase_message, exp_result):
266266
False,
267267
"/base_path/path_1?q=test",
268268
),
269+
(
270+
"http://base",
271+
["message:send"],
272+
None,
273+
False,
274+
False,
275+
"http://base/message:send",
276+
),
269277
),
270278
)
271279
def test_join_url_common_flows(base, parts, params, leading_slash, trailing_slash, exp_result):

0 commit comments

Comments
 (0)