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 6CB0GSkdyV8xDQAA0tVLHw (envelope-from ) for ; Thu, 03 Dec 2020 17:15:21 +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 Or1CFSkdyV9FSQAAB5/wlQ (envelope-from ) for ; Thu, 03 Dec 2020 17:15:21 +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 C250B940B62 for ; Thu, 3 Dec 2020 17:15:20 +0000 (UTC) Received: from localhost ([::1]:42470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kksCM-0006qd-7M for larch@yhetil.org; Thu, 03 Dec 2020 12:15:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkrzX-0000kk-2w for bug-guix@gnu.org; Thu, 03 Dec 2020 12:02:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58257) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kkrzW-0003yn-5u for bug-guix@gnu.org; Thu, 03 Dec 2020 12:02:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kkrzW-0004QF-2N for bug-guix@gnu.org; Thu, 03 Dec 2020 12:02:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#44906: Substitute requests fail if URL has trailing slash Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 03 Dec 2020 17:02: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: Hartmut Goebel Received: via spool by 44906-submit@debbugs.gnu.org id=B44906.160701487814869 (code B ref 44906); Thu, 03 Dec 2020 17:02:02 +0000 Received: (at 44906) by debbugs.gnu.org; 3 Dec 2020 17:01:18 +0000 Received: from localhost ([127.0.0.1]:41568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkryo-0003rO-EB for submit@debbugs.gnu.org; Thu, 03 Dec 2020 12:01:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkryl-0003l3-FH for 44906@debbugs.gnu.org; Thu, 03 Dec 2020 12:01:17 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47122) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkryf-0003dT-FZ; Thu, 03 Dec 2020 12:01:09 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=51424 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kkryc-0006FX-Gp; Thu, 03 Dec 2020 12:01:09 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <3848e5d4-3694-e7f4-cb42-f97a51bde5b4@crazy-compilers.com> <86a6v2qslp.fsf@gmail.com> <7b367712-d759-ba3d-3ffc-d3323cb859c7@crazy-compilers.com> Date: Thu, 03 Dec 2020 18:01:05 +0100 In-Reply-To: <7b367712-d759-ba3d-3ffc-d3323cb859c7@crazy-compilers.com> (Hartmut Goebel's message of "Sat, 28 Nov 2020 10:47:31 +0100") Message-ID: <87im9iddta.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) 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.78 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: C250B940B62 X-Spam-Score: -2.78 X-Migadu-Scanner: ns3122888.ip-94-23-21.eu X-TUID: wUiv8RaR5QHA Hi, 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-c= lient), say, and use it in (guix scripts substitute). Eventually it would be nice to have that in (web uri). Thoughts? Ludo=E2=80=99.