Skip to content

Commit 190509b

Browse files
author
Ziqun Ye
committed
fix unit test
1 parent 350f0ea commit 190509b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ads/model/deployment/common/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,11 @@ def send_request(
119119
Returns:
120120
A JSON representive of a requests.Response object.
121121
"""
122-
123122
if is_json_payload:
124-
header["Content-Type"] = header.pop("content_type", DEFAULT_CONTENT_TYPE_JSON)
123+
header["Content-Type"] = header.pop("content_type", DEFAULT_CONTENT_TYPE_JSON) or DEFAULT_CONTENT_TYPE_JSON
125124
request_kwargs = {"json": data}
126125
else:
127-
header["Content-Type"] = header.pop("content_type", DEFAULT_CONTENT_TYPE_BYTES)
126+
header["Content-Type"] = header.pop("content_type", DEFAULT_CONTENT_TYPE_BYTES) or DEFAULT_CONTENT_TYPE_BYTES
128127
request_kwargs = {"data": data} # should pass bytes when using data
129128

130129
request_kwargs["headers"] = header

0 commit comments

Comments
 (0)