Skip to content

Commit f9112be

Browse files
committed
Do not call blocking content property and lazily load response on first access
This reverts commit 7ce89a0 and improves it
1 parent c69316d commit f9112be

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: locust/contrib/fasthttp.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,8 @@ class ResponseContextManager(FastResponse):
578578
def __init__(self, response, environment, request_meta):
579579
# copy data from response to this object
580580
self.__dict__ = response.__dict__
581-
self._cached_content = response.content
581+
if response._cached_content:
582+
self._cached_content = response._cached_content
582583
# store reference to locust Environment
583584
self._environment = environment
584585
self.request_meta = request_meta

0 commit comments

Comments
 (0)