GNU bug report logs -
#19439
HTTP client rejects invalid ETag headers
Previous Next
Reported by: rekado <rekado <at> elephly.net>
Date: Thu, 25 Dec 2014 10:55:02 UTC
Severity: normal
Done: Andy Wingo <wingo <at> pobox.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
rekado <rekado <at> elephly.net> skribis:
> $ ./pre-inst-env guix download http://icedtea.wildebeest.org/hg/icepick/archive/15425b469aea.tar.gz
> starting download of `/tmp/guix-file.zrKNcT' from `http://icedtea.wildebeest.org/hg/icepick/archive/15425b469aea.tar.gz'...
> ERROR: Bad qstring header component: 1200667312.0
Indeed. The HTTP headers here look like this:
--8<---------------cut here---------------start------------->8---
Date: Fri, 26 Dec 2014 22:10:49 GMT
Server: Apache/2.2.22 (Debian)
ETag: 1200667312.0
--8<---------------cut here---------------end--------------->8---
For details, this can be reproduced like this:
--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> ,use(web client)
scheme@(guile-user)> (http-get "http://icedtea.wildebeest.org/hg/icepick/archive/15425b469aea.tar.gz")
web/http.scm:854:12: In procedure parse-entity-tag:
web/http.scm:854:12: Bad qstring header component: 1200667312.0
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ,bt
In web/client.scm:
228:8 4 (request "http://icedtea.wildebeest.org/hg/icepick/archive/15425b469aea.tar.gz" #:body #f #:port #<input-output: s…> …)
In web/response.scm:
199:6 3 (read-response #<input-output: socket 13>)
In web/http.scm:
218:33 2 (lp ((server . "Apache/2.2.22 (Debian)") (date . #<date nanosecond: 0 second: 3 minute: 14 hour: 22 day: 26 mont…>)))
188:11 1 (read-header #<input-output: socket 13>)
854:12 0 (parse-entity-tag "1200667312.0")
--8<---------------cut here---------------end--------------->8---
And indeed, Section 14.19 of
<http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html> says that the
‘ETag’ header has type ‘entity-tag’.
‘parse-entity-tag’ is written like this:
--8<---------------cut here---------------start------------->8---
(define (parse-entity-tag val)
(if (string-prefix? "W/" val)
(cons (parse-qstring val 2) #f)
(cons (parse-qstring val) #t)))
--8<---------------cut here---------------end--------------->8---
Section 3.11 at <http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html>
confirms the above definition for ‘entity-tag’.
Lastly, ‘quoted-string’ in
<http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html> is defined as a
string surrounded by double quotes, basically.
So, in short, I think Apache httpd is returning an invalid ETag header,
and Guile’s HTTP client is right in rejecting it.
Having said that doesn’t help much though. I’m not sure how frequent
this is, and whether/how this could be worked around. Ideas?
Thanks,
Ludo’.
This bug report was last modified 9 years and 52 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.