From 8a912e87449bd6e56ac8a83f25d0ca58982a81d3 Mon Sep 17 00:00:00 2001 From: polina4096 Date: Sun, 4 Jun 2023 03:00:12 +0300 Subject: [PATCH] Fix remote URL content length check off-by-one Fixes #85 --- fhost.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fhost.py b/fhost.py index 3d45c4d..8201954 100755 --- a/fhost.py +++ b/fhost.py @@ -400,7 +400,7 @@ def store_url(url, addr, ua, secret: bool): if "content-length" in r.headers: l = int(r.headers["content-length"]) - if l < app.config["MAX_CONTENT_LENGTH"]: + if l <= app.config["MAX_CONTENT_LENGTH"]: def urlfile(**kwargs): return type('',(),kwargs)()