diff --git a/locust/contrib/fasthttp.py b/locust/contrib/fasthttp.py index f52eac936a..84a4a749da 100644 --- a/locust/contrib/fasthttp.py +++ b/locust/contrib/fasthttp.py @@ -23,7 +23,7 @@ from charset_normalizer import detect from gevent.timeout import Timeout from geventhttpclient._parser import HTTPParseError -from geventhttpclient.client import HTTPClientPool +from geventhttpclient.client import HTTPClientPool, HTTPClient from geventhttpclient.header import Headers from geventhttpclient.response import HTTPConnectionClosed, HTTPSocketPoolResponse from geventhttpclient.useragent import CompatRequest, CompatResponse, ConnectionError, UserAgent @@ -164,10 +164,12 @@ def _send_request_safe_mode(self, method: str, url: str, **kwargs): if hasattr(e, "response"): r = e.response else: + req_headers = HTTPClient.DEFAULT_HEADERS.copy() + req_headers.update(kwargs.get("headers")) req = self.client._make_request( url, method=method, - headers=kwargs.get("headers"), + headers=req_headers, payload=kwargs.get("payload"), params=kwargs.get("params"), )