diff --git a/CHANGES.md b/CHANGES.md index 182edf4..3a995d3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,7 @@ # Changelog +## 3.6.3 +* [FIX] The ``join_url`` util has been tuned to encode the URL properly when the path is present. That led to the invalid URL being built. + ## 3.6.2 * Resolve a couple of security concerns by updating `cryptography` package to `42.0.4`. * [High] cryptography NULL pointer dereference with pkcs12.serialize_key_and_certificates when called with a non-matching certificate and private key and an hmac_hash override diff --git a/async_firebase/utils.py b/async_firebase/utils.py index 18d916c..5e52520 100644 --- a/async_firebase/utils.py +++ b/async_firebase/utils.py @@ -46,7 +46,7 @@ def join_url( """ url = base if parts: - quoted_and_stripped_parts = [quote(str(part).strip("/"), safe=":") for part in 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 diff --git a/pyproject.toml b/pyproject.toml index c62cc8c..c0ad2e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "async-firebase" -version = "3.6.2" +version = "3.6.3" description = "Async Firebase Client - a Python asyncio client to interact with Firebase Cloud Messaging in an easy way." license = "MIT" authors = [ diff --git a/tests/test_utils.py b/tests/test_utils.py index bbd111d..1ee88eb 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -274,6 +274,14 @@ def test_cleanup_firebase_message(firebase_message, exp_result): False, "http://base/message:send", ), + ( + "https://fcm.googleapis.com", + ["/v1/projects/my-project", "messages:send"], + None, + False, + False, + "https://fcm.googleapis.com/v1/projects/my-project/messages:send", + ), ), ) def test_join_url_common_flows(base, parts, params, leading_slash, trailing_slash, exp_result):