Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(sdk): require httpx 0.27.1 so Python query values stay escaped

Yudhi Armyndharis26755de7b1aa
diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml
index 804841949..1c28cbed5 100644
--- a/sdk/python/pyproject.toml
+++ b/sdk/python/pyproject.toml
@@ -15,7 +15,7 @@ authors = [
keywords = ["whatsapp", "api", "sdk", "openwa", "gateway"]
dependencies = [
- "httpx>=0.25.0,<1.0",
+ "httpx>=0.27.1,<1.0",
"typing_extensions>=4.0; python_version < '3.11'",
]
diff --git a/sdk/python/tests/test_sdk.py b/sdk/python/tests/test_sdk.py
index 0ec7236af..e55237852 100644
--- a/sdk/python/tests/test_sdk.py
+++ b/sdk/python/tests/test_sdk.py
@@ -139,6 +139,11 @@ class TestClientCore:
assert "chatId=a%40c.us" in url
assert "limit=10" in url
+ def test_build_url_escapes_a_literal_percent_in_a_query_value(self):
+ # httpx before 0.27.1 sent "%41" unescaped, so the gateway decoded it to "A".
+ assert build_url("http://x", "/api/search", {"q": "%41"}).endswith("q=%2541")
+ assert build_url("http://x", "/api/search", {"q": "50%"}).endswith("q=50%25")
+
def test_build_url_omits_none_valued_params(self):
# The behaviour a caller depends on: a None never reaches the wire as the literal "None".
# Tested here because build_url is what implements it — the typed resource signatures