From: Fredrik Tolf Date: Mon, 27 Jan 2025 19:56:26 +0000 (+0100) Subject: Fix phttpdate bug. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=e359479b3b256ea6c6164d80724b7d9cca7281c5;p=wrw.git Fix phttpdate bug. --- 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