Skip to content

Commit

Permalink
Update http_requests.py
Browse files Browse the repository at this point in the history
  • Loading branch information
saimedhi authored Feb 22, 2024
1 parent 4e5e9aa commit 921cd55
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions opensearchpy/connection/http_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ def perform_request( # type: ignore
raise ConnectionTimeout("TIMEOUT", str(e), e)
raise ConnectionError("N/A", str(e), e)

# Add the service time to the response headers
# Add the service time to the raw_data
if calculate_service_time:
raw_data["__client"] = {"Service_Time": str(duration)}

raw_data = raw_data.rstrip()[:-1] + f', "__client": {{"Service_Time": "{duration}"}}' + '}'

Check warning on line 219 in opensearchpy/connection/http_requests.py

View check run for this annotation

Codecov / codecov/patch

opensearchpy/connection/http_requests.py#L219

Added line #L219 was not covered by tests
# raise warnings if any from the 'Warnings' header.
warnings_headers = (
(response.headers["warning"],) if "warning" in response.headers else ()
Expand Down

0 comments on commit 921cd55

Please sign in to comment.