ideal-postcodes 0.2.1__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ideal_postcodes-0.2.1 → ideal_postcodes-0.2.2}/PKG-INFO +1 -1
- {ideal_postcodes-0.2.1 → ideal_postcodes-0.2.2}/ideal_postcodes/_transport.py +4 -1
- {ideal_postcodes-0.2.1 → ideal_postcodes-0.2.2}/pyproject.toml +1 -1
- {ideal_postcodes-0.2.1 → ideal_postcodes-0.2.2}/pyproject.toml.orig +1 -1
- {ideal_postcodes-0.2.1 → ideal_postcodes-0.2.2}/LICENSE +0 -0
- {ideal_postcodes-0.2.1 → ideal_postcodes-0.2.2}/README.md +0 -0
- {ideal_postcodes-0.2.1 → ideal_postcodes-0.2.2}/ideal_postcodes/__init__.py +0 -0
- {ideal_postcodes-0.2.1 → ideal_postcodes-0.2.2}/ideal_postcodes/client.py +0 -0
- {ideal_postcodes-0.2.1 → ideal_postcodes-0.2.2}/ideal_postcodes/errors.py +0 -0
- {ideal_postcodes-0.2.1 → ideal_postcodes-0.2.2}/ideal_postcodes/py.typed +0 -0
- {ideal_postcodes-0.2.1 → ideal_postcodes-0.2.2}/ideal_postcodes/requests.py +0 -0
- {ideal_postcodes-0.2.1 → ideal_postcodes-0.2.2}/ideal_postcodes/types.py +0 -0
|
@@ -182,7 +182,10 @@ class Transport:
|
|
|
182
182
|
if response.status_code != 200:
|
|
183
183
|
raise ProtocolError(f"Unexpected success status {response.status_code}")
|
|
184
184
|
if result_shape == "csv":
|
|
185
|
-
|
|
185
|
+
# The API sends `text/csv name="..."`, a space before the parameter rather than a
|
|
186
|
+
# semicolon, so the media type ends at the first semicolon or whitespace.
|
|
187
|
+
media_type = (response.headers.get("Content-Type", "").replace(";", " ").split() or [""])[0].lower()
|
|
188
|
+
if media_type != "text/csv":
|
|
186
189
|
raise ProtocolError("Expected a CSV response")
|
|
187
190
|
return response.text
|
|
188
191
|
if envelope.get("code") != 2000 or "result" not in envelope or envelope["result"] is None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|