From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: [patch] Location header is a URI-reference Date: Thu, 16 Oct 2014 14:19:38 +0200 Message-ID: <8738ao6wbp.fsf@gnu.org> References: <874mv5zmhw.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1413462006 24147 80.91.229.3 (16 Oct 2014 12:20:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Oct 2014 12:20:06 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Oct 16 14:20:00 2014 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xek29-0001TG-QM for guile-devel@m.gmane.org; Thu, 16 Oct 2014 14:19:57 +0200 Original-Received: from localhost ([::1]:50153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xek29-0002BL-Bw for guile-devel@m.gmane.org; Thu, 16 Oct 2014 08:19:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xek1y-00024O-TE for guile-devel@gnu.org; Thu, 16 Oct 2014 08:19:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xek1t-0003Wg-UR for guile-devel@gnu.org; Thu, 16 Oct 2014 08:19:46 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:48591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xek1t-0003WQ-O1 for guile-devel@gnu.org; Thu, 16 Oct 2014 08:19:41 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xek1s-0001KS-2N for guile-devel@gnu.org; Thu, 16 Oct 2014 14:19:40 +0200 Original-Received: from pluto.bordeaux.inria.fr ([193.50.110.57]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Oct 2014 14:19:40 +0200 Original-Received: from ludo by pluto.bordeaux.inria.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Oct 2014 14:19:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 52 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: pluto.bordeaux.inria.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 25 =?utf-8?Q?Vend=C3=A9miaire?= an 223 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.130011 (Ma Gnus v0.11) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:X6odynaMw+NLBjaum0iSESW2/Jg= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17588 Archived-At: Andy Wingo 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 , right? > commit 81f61a615ff8c5c5d6e270c255c15eb164f3456c > Author: Andy Wingo > 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’.