Skip to content

Commit 921cd55

Browse files
authored
Update http_requests.py
1 parent 4e5e9aa commit 921cd55

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

opensearchpy/connection/http_requests.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,10 @@ def perform_request( # type: ignore
214214
raise ConnectionTimeout("TIMEOUT", str(e), e)
215215
raise ConnectionError("N/A", str(e), e)
216216

217-
# Add the service time to the response headers
217+
# Add the service time to the raw_data
218218
if calculate_service_time:
219-
raw_data["__client"] = {"Service_Time": str(duration)}
220-
219+
raw_data = raw_data.rstrip()[:-1] + f', "__client": {{"Service_Time": "{duration}"}}' + '}'
220+
221221
# raise warnings if any from the 'Warnings' header.
222222
warnings_headers = (
223223
(response.headers["warning"],) if "warning" in response.headers else ()

0 commit comments

Comments
 (0)