From 8e0a84cc70a00206b022a588ac3aba3e977636e7 Mon Sep 17 00:00:00 2001 From: Gareth Ellis Date: Fri, 31 Jan 2025 17:54:07 +0100 Subject: [PATCH] Add check if headers is not None before treating it like a dict --- esrally/client/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esrally/client/common.py b/esrally/client/common.py index dc6ec0bb7..e0ca051c9 100644 --- a/esrally/client/common.py +++ b/esrally/client/common.py @@ -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)