Skip to content

Commit

Permalink
Add check if headers is not None before treating it like a dict
Browse files Browse the repository at this point in the history
  • Loading branch information
gareth-ellis committed Jan 31, 2025
1 parent c5b469d commit 8e0a84c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion esrally/client/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def _client_major_version_to_str(version: tuple) -> str:
def _mimetype_header_to_compat(header, request_headers):
# Converts all parts of a Accept/Content-Type headers
# from application/X -> application/vnd.elasticsearch+X
mimetype = request_headers.get(header, None)
mimetype = request_headers.get(header, None) if request_headers else None
if mimetype:
request_headers[header] = _COMPAT_MIMETYPE_RE.sub(_COMPAT_MIMETYPE_SUB, mimetype)

Expand Down

0 comments on commit 8e0a84c

Please sign in to comment.