We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47e8d15 commit 8b1a4b2Copy full SHA for 8b1a4b2
elasticsearch/connection/http_urllib3.py
@@ -24,7 +24,7 @@
24
from urllib3.exceptions import SSLError as UrllibSSLError # type: ignore
25
from urllib3.util.retry import Retry # type: ignore
26
27
-from ..compat import reraise_exceptions, urlencode
+from ..compat import reraise_exceptions, to_str, urlencode
28
from ..exceptions import (
29
ConnectionError,
30
ConnectionTimeout,
@@ -243,6 +243,10 @@ def perform_request(
243
244
request_headers = self.headers.copy()
245
request_headers.update(headers or ())
246
+ request_headers = {
247
+ to_str(header, "latin-1"): to_str(value, "latin-1")
248
+ for header, value in request_headers.items()
249
+ }
250
251
if self.http_compress and body:
252
body = self._gzip_compress(body)
0 commit comments