1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 03:30:27 +02:00

http: Accept date strings with a leading space for hours.

Fixes <http://bugs.gnu.org/23421>.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

* module/web/http.scm (parse-rfc-822-date): Add two clauses for hours
with a leading space.
* test-suite/tests/web-http.test ("general headers"): Add two tests.
This commit is contained in:
Ludovic Courtès 2016-05-08 21:52:33 +02:00
parent 6b73c87f58
commit 16050431f2
2 changed files with 30 additions and 0 deletions

View file

@ -236,6 +236,16 @@
(pass-if-parse date "Wed, 7 Sep 2011 11:25:00 GMT"
(string->date "Wed, 7 Sep 2011 11:25:00 +0000"
"~a,~e ~b ~Y ~H:~M:~S ~z"))
;; This is a non-conforming date (lack of leading zero for the hours)
;; that some HTTP servers provide. See <http://bugs.gnu.org/23421>.
(pass-if-parse date "Sun, 06 Nov 1994 8:49:37 GMT"
(string->date "Sun, 6 Nov 1994 08:49:37 +0000"
"~a,~e ~b ~Y ~H:~M:~S ~z"))
(pass-if-parse date "Sun, 6 Nov 1994 8:49:37 GMT"
(string->date "Sun, 6 Nov 1994 08:49:37 +0000"
"~a,~e ~b ~Y ~H:~M:~S ~z"))
(pass-if-parse-error date "Tue, 15 Nov 1994 08:12:31 EST" date)
(pass-if-any-error date "Tue, 15 Qux 1994 08:12:31 EST")