From: Oleg Broytman Date: Sun, 19 Nov 2023 23:58:53 +0000 (+0300) Subject: Fix(robots): Fix "Content-Length" header returning `None` X-Git-Tag: 5.0.0~17 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=618c0790e113546e3f60bf001d5c36b048a75b30;p=bookmarks_db.git Fix(robots): Fix "Content-Length" header returning `None` --- diff --git a/Robots/bkmk_robot_base.py b/Robots/bkmk_robot_base.py index ad0f6d2..32f8c68 100644 --- a/Robots/bkmk_robot_base.py +++ b/Robots/bkmk_robot_base.py @@ -90,7 +90,7 @@ class robot_base(Robot): try: size = headers["Content-Length"] except KeyError: - size = len(content) + pass try: last_modified = headers["Last-Modified"] @@ -99,7 +99,8 @@ class robot_base(Robot): if last_modified: last_modified = parse_time(last_modified) - else: + + if not size: # Could be None from headers size = len(content) if last_modified: