Skip to content

Commit e4f3dd1

Browse files
authored
Merge pull request #49 from dataiku/bug/sc-224905-utf-8-encoding
Bug/sc 224905 utf 8 encoding
2 parents a9e4d30 + 9ee25a6 commit e4f3dd1

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Fix xml decoding for content type application/atom+xml
66
- Dump returned content that can't be decoded
77
- Fix: Empty cells in the recipe's input dataset now produce an empty string instead of a 'nan' string
8+
- Fix: UTF-8 encoding of raw mode body
89

910
## [Version 1.2.2](https://github.com/dataiku/dss-plugin-api-connect/releases/tag/v1.2.2) - Feature release - 2024-02-14
1011

python-lib/dku_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ class DKUConstants(object):
22
API_RESPONSE_KEY = "api_response"
33
FORBIDDEN_KEYS = ["token", "password", "api_key_value", "secure_token"]
44
FORM_DATA_BODY_FORMAT = "FORM_DATA"
5-
PLUGIN_VERSION = "1.2.3-beta.4"
5+
PLUGIN_VERSION = "1.2.3-beta.5"
66
RAW_BODY_FORMAT = "RAW"
77
REPONSE_ERROR_KEY = "dku_error"

python-lib/rest_api_client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ def request(self, method, url, can_raise_exeption=True, **kwargs):
128128
error_message = None
129129
status_code = None
130130
response_headers = None
131+
if "data" in kwargs:
132+
data = kwargs.get("data")
133+
if isinstance(data, str):
134+
kwargs["data"] = data.encode("utf-8")
131135
try:
132136
response = self.request_with_redirect_retry(method, url, **kwargs)
133137
status_code = response.status_code

0 commit comments

Comments
 (0)