From 1892328b3ec35268041d1a7f5bb5c9dcd7201eb0 Mon Sep 17 00:00:00 2001 From: ScottR Date: Wed, 8 Nov 2023 19:54:55 +1100 Subject: [PATCH] issue-2450-encoding return str when None --- locust/contrib/fasthttp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locust/contrib/fasthttp.py b/locust/contrib/fasthttp.py index 9887b06297..4f0720e2a4 100644 --- a/locust/contrib/fasthttp.py +++ b/locust/contrib/fasthttp.py @@ -463,7 +463,7 @@ def text(self) -> Optional[str]: if self.headers is None: self.encoding = "utf-8" else: - self.encoding = get_encoding_from_headers(self.headers) + self.encoding = get_encoding_from_headers(self.headers) or "" return str(self.content, self.encoding, errors="replace") @property