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: Fri, 30 Oct 2015 16:00:19 +0100 Message-ID: <8737wsiepo.fsf@gnu.org> References: <874mv5zmhw.fsf@pobox.com> <8738ao6wbp.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1446217249 28984 80.91.229.3 (30 Oct 2015 15:00:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Oct 2015 15:00:49 +0000 (UTC) Cc: guile-devel To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Oct 30 16:00:43 2015 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 1ZsBAR-0004R9-HR for guile-devel@m.gmane.org; Fri, 30 Oct 2015 16:00:35 +0100 Original-Received: from localhost ([::1]:51097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsBAR-0007qE-3t for guile-devel@m.gmane.org; Fri, 30 Oct 2015 11:00:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsBAI-0007q5-QK for guile-devel@gnu.org; Fri, 30 Oct 2015 11:00:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsBAE-0001QF-Im for guile-devel@gnu.org; Fri, 30 Oct 2015 11:00:26 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsBAE-0001Q6-Ex; Fri, 30 Oct 2015 11:00:22 -0400 Original-Received: from pluto.bordeaux.inria.fr ([193.50.110.57]:36020 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1ZsBAD-0003su-Vl; Fri, 30 Oct 2015 11:00:22 -0400 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 Brumaire an 224 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x3D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <8738ao6wbp.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 16 Oct 2014 14:19:38 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e 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:17960 Archived-At: Ping! ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > 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 >>=20=20=20=20=20 >> * 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. >>=20=20=20=20=20 >> * module/web/request.scm (request-absolute-uri): Add default-scheme >> optional argument. Use it if the request-uri has no scheme, or >> error. >>=20=20=20=20=20 >> * module/web/http.scm (write-uri): Reflow to use "when". Fix writin= g 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. >>=20=20=20=20=20 >> * module/web/client.scm (open-socket-for-uri): Handle the case in wh= ich >> there is no URI scheme. >>=20=20=20=20=20 >> * 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 > =E2=80=9Cnormal=E2=80=9D URI objects suddenly gets objects that are reall= y URI > references. (Just thinking out loud.) > > Thanks for working on it! > > Ludo=E2=80=99.