fix(handlers): positive content-length check
Python Lint CI / ruff (push) Successful in 5m33s
Python Lint CI / ruff-format-check (push) Successful in 4m44s
Python Lint CI / ty (push) Successful in 4m42s
Docker CI / docker-build (push) Successful in 6m50s
Python Test CI / coverage (push) Failing after 2m13s
Python Lint CI / ruff (push) Successful in 5m33s
Python Lint CI / ruff-format-check (push) Successful in 4m44s
Python Lint CI / ty (push) Successful in 4m42s
Docker CI / docker-build (push) Successful in 6m50s
Python Test CI / coverage (push) Failing after 2m13s
This commit is contained in:
+1
-1
@@ -252,7 +252,7 @@ class BaseHandler(abc.ABC, http.server.BaseHTTPRequestHandler):
|
|||||||
return self.__in_size
|
return self.__in_size
|
||||||
|
|
||||||
def _get_length(self) -> int:
|
def _get_length(self) -> int:
|
||||||
return int(self._get_header("Content-Length", "0"))
|
return max(0, int(self._get_header("Content-Length", "0")))
|
||||||
|
|
||||||
def _get_header(self, key: str, default_value: str = "") -> str:
|
def _get_header(self, key: str, default_value: str = "") -> str:
|
||||||
if self._has_header(key):
|
if self._has_header(key):
|
||||||
|
|||||||
Reference in New Issue
Block a user