bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#12827: [2.0.6] web client: fails to parse 404 header


From: Ludovic Courtès
Subject: bug#12827: [2.0.6] web client: fails to parse 404 header
Date: Thu, 08 Nov 2012 21:10:45 +0100
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux)

Hi Daniel,

Thanks for the quick reply and patch!

Daniel Hartwig <address@hidden> skribis:

> On 8 November 2012 04:40, Ludovic Courtès <address@hidden> wrote:
>> scheme@(guile-user)> (use-modules (web client) (web uri))
>> scheme@(guile-user)> (http-get (string->uri 
>> "http://www.gnu.org/does-not-exist";))
>> web/http.scm:191:11: In procedure read-header:
>> web/http.scm:191:11: Bad uri header component: gnu-404.html
>
> Some headers are supposed to support these “URI-references”.

Oh, OK.

> * TODO maybe use more scheme-ish names instead of RFC 3986
> This latest RFC makes a clear distinction between an actual URI
> and a reference to such.  I thought it best to reflect that
> distinction, but maybe it does pollute the namespace a bit:
> - absolute-uri? → uri-absolute?
> - relative-ref? → uri-relative?

No, I’d keep the names on the left.

Name space control is best left to ‘use-modules’ forms, anyway.

> * TODO build-uri validation is broken/less strict and will now pass
> relative-refs, so maybe introduce build-uri-reference instead

Yes.  Should uri-reference be a disjoint type, then?

> -(declare-uri-header! "Content-Location")
> +(declare-uri-reference-header! "Content-Location")

OK.

>  ;; Content-MD5 = <base64 of 128 bit MD5 digest as per RFC 1864>
>  ;;
> @@ -1729,7 +1736,7 @@ treated specially, and is just returned as a plain 
> string."
>  
>  ;; Referer = ( absoluteURI | relativeURI )
>  ;;
> -(declare-uri-header! "Referer")
> +(declare-uri-reference-header! "Referer")

Should actually be “Referrer”, no?

> +(define (absolute-uri? uri)
> +  (and (uri? uri) (uri-scheme uri) #t))

Eventually, we’ll need docstrings, and updated documentation.

Thanks,
Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]