aboutsummaryrefslogtreecommitdiff
path: root/src/utils/http.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-09-17 17:33:23 +0100
committerGravatar jesopo2019-09-17 17:33:23 +0100
commitee6360be222ad1027d899445de34cd0dd8efa6f5 (patch)
tree0fc14142cbfd45d0f69cdc719177039eeb54127d /src/utils/http.py
parentlog which URL caused an error in request_many (diff)
signature
don't check already-read data when checking for too-large requests
this check was here because the first read will return empty if it was an invalid byte sequence for e.g. gzip because we needed to receive more data. the second read will always return data (not decoded) so regardless of what the already-read data is, the second read is the only criteria we need.
Diffstat (limited to 'src/utils/http.py')
-rw-r--r--src/utils/http.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils/http.py b/src/utils/http.py
index 4f508f6c..a6a074ab 100644
--- a/src/utils/http.py
+++ b/src/utils/http.py
@@ -167,7 +167,7 @@ def _request(request_obj: Request) -> Response:
)
response_content = response.raw.read(RESPONSE_MAX,
decode_content=True)
- if not response_content or not response.raw.read(1) == b"":
+ if not response.raw.read(1) == b"":
raise ValueError("Response too large")
our_response = Response(response.status_code, response_content,