Skip to content

Commit 4c4091b

Browse files
authored
Fix DeprecationWarning raised by urllib3 1.26.13 (opensearch-project#246)
* Fix DeprecationWarning raised by urllib3 1.26.13 urllib3 has started to emit a DeprecationWarning whenever HTTPResponse.getheaders() is called since version 1.26.13. This changes the one place where this is done to instead use HTTPResponse.headers instead, which is the recommend way of retrieving the headers going forwards. Signed-off-by: Jeppe Fihl-Pearson <jeppe@memrise.com> * Add CHANGELOG entry Signed-off-by: Jeppe Fihl-Pearson <jeppe@memrise.com> Signed-off-by: Jeppe Fihl-Pearson <jeppe@memrise.com>
1 parent b6b35f4 commit 4c4091b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1818
### Removed
1919

2020
### Fixed
21-
21+
- Fixed DeprecationWarning emitted from urllib3 1.26.13+ ([#246](https://github.com/opensearch-project/opensearch-py/pull/246))
2222
### Security
2323

2424

opensearchpy/connection/http_urllib3.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def perform_request(
273273
method, full_url, url, orig_body, response.status, raw_data, duration
274274
)
275275

276-
return response.status, response.getheaders(), raw_data
276+
return response.status, response.headers, raw_data
277277

278278
def get_response_headers(self, response):
279279
return {header.lower(): value for header, value in response.headers.items()}

0 commit comments

Comments
 (0)