From 21dd327766b724020f32d34797c8cd17a166e085 Mon Sep 17 00:00:00 2001 From: MasterX <153791429+MsterKey-Pro@users.noreply.github.com> Date: Fri, 10 Jan 2025 15:42:13 +0800 Subject: [PATCH] Add test case for iter_lines method --- 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 c23d2d0d20..aee368cc61 100644 --- a/locust/contrib/fasthttp.py +++ b/locust/contrib/fasthttp.py @@ -303,7 +303,7 @@ def iter_lines(self, url: str, **kwargs) -> Generator[str, None, None]: response = self.request("GET", url, stream=True, **kwargs) response.raise_for_status() buffer = "" - for chunk in response.iter_content(chunk_size=1024): + for chunk in response.iter_content(chunk_size=1024, decode_content=True): buffer += chunk.decode("utf-8") while "\n" in buffer: line, buffer = buffer.split("\n", 1)