Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. By the way I think the following would be more clear to read:

if request_headers:
  mimetype  = request_headers.get(header, None)
  if mimetype:
     ...

if mimetype:
request_headers[header] = _COMPAT_MIMETYPE_RE.sub(_COMPAT_MIMETYPE_SUB, mimetype)

Expand Down