Ping! l...@gnu.org (Ludovic Courtès) skribis:
> Andy Wingo <wi...@pobox.com> skribis: > >> Following RFC 7231, the HTTP Location: header is a URI-reference, not a >> URI. This patch updates Guile's web modules appropriately, fixes a case >> in which URI fragments were parsed incorrectly, and makes public >> interfaces for creating URI references. >> >> Thoughts? This is also in wip-uri-reference. > > Looks good! > > I think this addresses <http://bugs.gnu.org/12827>, right? > >> commit 81f61a615ff8c5c5d6e270c255c15eb164f3456c >> Author: Andy Wingo <wi...@pobox.com> >> Date: Wed Oct 15 11:49:41 2014 +0200 >> >> web: Location header is URI-reference; better URI-reference support >> >> * module/web/uri.scm (validate-uri): Add reference? keyword argument, >> for validating references. >> (build-uri): Clarify comments to indicate that the result is an >> absolute URI. >> (build-uri-reference): New interface, to build URI-references. >> (string->uri-reference): Rename from string->uri*. Fix fragment >> parsing to not include the #. >> (string->uri): Adapt to string->uri-reference name change. >> >> * module/web/request.scm (request-absolute-uri): Add default-scheme >> optional argument. Use it if the request-uri has no scheme, or >> error. >> >> * module/web/http.scm (write-uri): Reflow to use "when". Fix writing of >> URI-reference instances. >> (declare-uri-reference-header!): Rename from >> declare-relative-uri-header!. Use string->uri-reference. >> ("Location"): Declare as a URI-reference header, as per RFC 7231. >> >> * module/web/client.scm (open-socket-for-uri): Handle the case in which >> there is no URI scheme. >> >> * test-suite/tests/web-http.test: >> * test-suite/tests/web-uri.test: Add tests. > > Here the URI type is reused for URI references, which I think is good, > but could it introduce incompatibilities? Like code that has expected > “normal” URI objects suddenly gets objects that are really URI > references. (Just thinking out loud.) > > Thanks for working on it! > > Ludo’.