From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id OJ92JUy4yV/TNwAA0tVLHw (envelope-from ) for ; Fri, 04 Dec 2020 04:17:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id AIhHIUy4yV9SEgAAB5/wlQ (envelope-from ) for ; Fri, 04 Dec 2020 04:17:16 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0341E9403A9 for ; Fri, 4 Dec 2020 04:17:15 +0000 (UTC) Received: from localhost ([::1]:52102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kl2Wv-0002wb-53 for larch@yhetil.org; Thu, 03 Dec 2020 23:17:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kl2Wl-0002vA-4v for bug-guix@gnu.org; Thu, 03 Dec 2020 23:17:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59061) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kl2Wk-0008Bf-IP for bug-guix@gnu.org; Thu, 03 Dec 2020 23:17:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kl2Wk-0002D0-Ds for bug-guix@gnu.org; Thu, 03 Dec 2020 23:17:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#44906: Substitute requests fail if URL has trailing slash Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 04 Dec 2020 04:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44906 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Hartmut Goebel Received: via spool by 44906-submit@debbugs.gnu.org id=B44906.16070554068465 (code B ref 44906); Fri, 04 Dec 2020 04:17:02 +0000 Received: (at 44906) by debbugs.gnu.org; 4 Dec 2020 04:16:46 +0000 Received: from localhost ([127.0.0.1]:42374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kl2WU-0002CT-Ck for submit@debbugs.gnu.org; Thu, 03 Dec 2020 23:16:46 -0500 Received: from world.peace.net ([64.112.178.59]:59926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kl2WR-0002CF-VC for 44906@debbugs.gnu.org; Thu, 03 Dec 2020 23:16:45 -0500 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kl2WK-0005Fe-Sh; Thu, 03 Dec 2020 23:16:36 -0500 From: Mark H Weaver In-Reply-To: <87im9iddta.fsf@gnu.org> References: <3848e5d4-3694-e7f4-cb42-f97a51bde5b4@crazy-compilers.com> <86a6v2qslp.fsf@gmail.com> <7b367712-d759-ba3d-3ffc-d3323cb859c7@crazy-compilers.com> <87im9iddta.fsf@gnu.org> Date: Thu, 03 Dec 2020 23:15:45 -0500 Message-ID: <87zh2udx4j.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 44906@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.29 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 0341E9403A9 X-Spam-Score: -2.29 X-Migadu-Scanner: ns3122888.ip-94-23-21.eu X-TUID: VgPQoP3Kpr0W Hi, Ludovic Court=C3=A8s writes: > Hartmut Goebel skribis: > >> I propose fixing all places where string-append is used to join URLs, >> since joining URLs is not the same as string concatenation. We might=20 >> restrict our algorithm to only joining a >> path. shows the >> complete algorithm, where this is the relevant part for only joining a >> path (R.path) to a base URL's path (T.path). >> >> if (R.path starts-with "/") then >> T.path =3D remove_dot_segments(R.path); >> else >> T.path =3D merge(Base.path, R.path); >> T.path =3D remove_dot_segments(T.path); > > To begin with, we could define =E2=80=98url-append=E2=80=99 in (guix http= -client), say, > and use it in (guix scripts substitute). > > Eventually it would be nice to have that in (web uri). Note that 'resolve-uri-reference' in (guix build download) implements the algorithm specified in RFC 3986 section 5.2.2, for purposes of supporting HTTP redirects. Perhaps some of that code will be useful. Regards, Mark