From 618c0790e113546e3f60bf001d5c36b048a75b30 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 20 Nov 2023 02:58:53 +0300 Subject: [PATCH] Fix(robots): Fix "Content-Length" header returning `None` --- Robots/bkmk_robot_base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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: -- 2.39.5