From e359479b3b256ea6c6164d80724b7d9cca7281c5 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Mon, 27 Jan 2025 20:56:26 +0100 Subject: [PATCH] Fix phttpdate bug. --- wrw/proto.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrw/proto.py b/wrw/proto.py index 5a2fee7..fe907ea 100644 --- a/wrw/proto.py +++ b/wrw/proto.py @@ -47,7 +47,7 @@ def httpdate(ts): def phttpdate(dstr): tz = dstr[-6:] dstr = dstr[:-6] - if tz[0] != " " or (tz[1] != "+" and tz[1] != "-") or not tz[2:].isdigit(): + if len(tz) < 6 or tz[0] != " " or (tz[1] != "+" and tz[1] != "-") or not tz[2:].isdigit(): return None tz = int(tz[1:]) tz = (((tz / 100) * 60) + (tz % 100)) * 60 -- 2.39.5