Skip to content

Commit

Permalink
Only use headers if they are truthy
Browse files Browse the repository at this point in the history
  • Loading branch information
soitinj committed Sep 6, 2024
1 parent 9b39668 commit 8720324
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion locust/contrib/fasthttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ def _send_request_safe_mode(self, method: str, url: str, **kwargs):
r = e.response
else:
req_headers = HTTPClient.DEFAULT_HEADERS.copy()
req_headers.update(kwargs.get("headers"))
if given_headers := kwargs.get("headers"):
req_headers.update(given_headers)
req = self.client._make_request(
url,
method=method,
Expand Down

0 comments on commit 8720324

Please sign in to comment.