fix(handlers): positive content-length check
Python Lint CI / ruff (push) Successful in 1m8s
Python Lint CI / ty (push) Successful in 1m8s
Python Lint CI / ruff-format-check (push) Successful in 1m8s
Docker CI / docker-build (push) Has been cancelled
Python Test CI / coverage (push) Has been cancelled

This commit is contained in:
2026-06-02 22:26:38 +02:00
parent b234504b49
commit d2a656a839
+1 -1
View File
@@ -252,7 +252,7 @@ class BaseHandler(abc.ABC, http.server.BaseHTTPRequestHandler):
return self.__in_size
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:
if self._has_header(key):