GNU bug report logs - #44906
Substitute requests fail if URL has trailing slash

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: Hartmut Goebel <h.goebel@HIDDEN>; dated Fri, 27 Nov 2020 21:21:02 UTC; Maintainer for guix is bug-guix@HIDDEN.

Message received at 44906 <at> debbugs.gnu.org:


Received: (at 44906) by debbugs.gnu.org; 3 Dec 2020 17:01:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 03 12:01:18 2020
Received: from localhost ([127.0.0.1]:41568 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kkryo-0003rO-EB
	for submit <at> 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 <ludo@HIDDEN>) id 1kkryl-0003l3-FH
 for 44906 <at> 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 <ludo@HIDDEN>)
 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 <ludo@HIDDEN>)
 id 1kkryc-0006FX-Gp; Thu, 03 Dec 2020 12:01:09 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Hartmut Goebel <h.goebel@HIDDEN>
Subject: Re: bug#44906: Substitute requests fail if URL has trailing slash
References: <3848e5d4-3694-e7f4-cb42-f97a51bde5b4@HIDDEN>
 <86a6v2qslp.fsf@HIDDEN>
 <7b367712-d759-ba3d-3ffc-d3323cb859c7@HIDDEN>
Date: Thu, 03 Dec 2020 18:01:05 +0100
In-Reply-To: <7b367712-d759-ba3d-3ffc-d3323cb859c7@HIDDEN>
 (Hartmut Goebel's message of "Sat, 28 Nov 2020 10:47:31 +0100")
Message-ID: <87im9iddta.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44906
Cc: 44906 <at> debbugs.gnu.org, zimoun <zimon.toutoune@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Hartmut Goebel <h.goebel@HIDDEN> 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. <https://tools.ietf.org/html/rfc3986#section-5.2.2> 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.




Information forwarded to bug-guix@HIDDEN:
bug#44906; Package guix. Full text available.

Message received at 44906 <at> debbugs.gnu.org:


Received: (at 44906) by debbugs.gnu.org; 28 Nov 2020 09:47:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 28 04:47:40 2020
Received: from localhost ([127.0.0.1]:46969 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kiwpQ-0005x7-76
	for submit <at> debbugs.gnu.org; Sat, 28 Nov 2020 04:47:40 -0500
Received: from mail-out.m-online.net ([212.18.0.9]:53999)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <h.goebel@HIDDEN>) id 1kiwpN-0005wy-4X
 for 44906 <at> debbugs.gnu.org; Sat, 28 Nov 2020 04:47:38 -0500
Received: from frontend01.mail.m-online.net (unknown [192.168.8.182])
 by mail-out.m-online.net (Postfix) with ESMTP id 4Cjmr81nN6z1qs0P;
 Sat, 28 Nov 2020 10:47:36 +0100 (CET)
Received: from localhost (dynscan1.mnet-online.de [192.168.6.70])
 by mail.m-online.net (Postfix) with ESMTP id 4Cjmr8078lz1qv4t;
 Sat, 28 Nov 2020 10:47:35 +0100 (CET)
X-Virus-Scanned: amavisd-new at mnet-online.de
Received: from mail.mnet-online.de ([192.168.8.182])
 by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,
 port 10024)
 with ESMTP id xFaehybHDt0Z; Sat, 28 Nov 2020 10:47:34 +0100 (CET)
Received: from hermia.goebel-consult.de
 (ppp-188-174-58-171.dynamic.mnet-online.de [188.174.58.171])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mail.mnet-online.de (Postfix) with ESMTPS;
 Sat, 28 Nov 2020 10:47:34 +0100 (CET)
Received: from lenashee.goebel-consult.de (lenashee.goebel-consult.de
 [192.168.110.2])
 by hermia.goebel-consult.de (Postfix) with ESMTP id 6CF78602A2;
 Sat, 28 Nov 2020 10:48:14 +0100 (CET)
Subject: Re: bug#44906: Substitute requests fail if URL has trailing slash
To: zimoun <zimon.toutoune@HIDDEN>, 44906 <at> debbugs.gnu.org
References: <3848e5d4-3694-e7f4-cb42-f97a51bde5b4@HIDDEN>
 <86a6v2qslp.fsf@HIDDEN>
From: Hartmut Goebel <h.goebel@HIDDEN>
Organization: crazy-compilers.com
Message-ID: <7b367712-d759-ba3d-3ffc-d3323cb859c7@HIDDEN>
Date: Sat, 28 Nov 2020 10:47:31 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
 Thunderbird/78.5.0
MIME-Version: 1.0
In-Reply-To: <86a6v2qslp.fsf@HIDDEN>
Content-Type: multipart/alternative;
 boundary="------------68AA154E086793323F917DC4"
Content-Language: en-US
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 44906
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

This is a multi-part message in MIME format.
--------------68AA154E086793323F917DC4
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

Am 28.11.20 um 00:37 schrieb zimoun:
> Now, the question is where should the fix go?  “guix publish” exposing
> the narinfos or “guix weather“?  Or both?

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 
restrict our algorithm to only joining a path. 
<https://tools.ietf.org/html/rfc3986#section-5.2.2> 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 = remove_dot_segments(R.path);
                else
                   T.path = merge(Base.path, R.path);
                   T.path = remove_dot_segments(T.path);

(Side-node: guile module (web uri) 
<https://www.gnu.org/software/guile/manual/html_node/URIs.html> seems to 
lack respective, easy to use functions.)

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@HIDDEN               |
| www.crazy-compilers.com | compilers which you thought are impossible |


--------------68AA154E086793323F917DC4
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">Am 28.11.20 um 00:37 schrieb zimoun:<br>
    </div>
    <blockquote type="cite" cite="mid:86a6v2qslp.fsf@HIDDEN">
      <pre class="moz-quote-pre" wrap="">Now, the question is where should the fix go?  “guix publish” exposing
the narinfos or “guix weather“?  Or both?
</pre>
    </blockquote>
    <p>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 restrict our algorithm to only joining a path.
      <a class="moz-txt-link-rfc2396E" href="https://tools.ietf.org/html/rfc3986#section-5.2.2">&lt;https://tools.ietf.org/html/rfc3986#section-5.2.2&gt;</a> 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).<br>
    </p>
    <pre class="newpage">               if (R.path starts-with "/") then
                  T.path = remove_dot_segments(R.path);
               else
                  T.path = merge(Base.path, R.path);
                  T.path = remove_dot_segments(T.path);

</pre>
    <p>(Side-node: guile module (web uri)
      <a class="moz-txt-link-rfc2396E" href="https://www.gnu.org/software/guile/manual/html_node/URIs.html">&lt;https://www.gnu.org/software/guile/manual/html_node/URIs.html&gt;</a>
      seems to lack respective, easy to use functions.)<br>
    </p>
    <pre class="moz-signature" cols="72">-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | <a class="moz-txt-link-abbreviated" href="mailto:h.goebel@HIDDEN">h.goebel@HIDDEN</a>               |
| <a class="moz-txt-link-abbreviated" href="http://www.crazy-compilers.com">www.crazy-compilers.com</a> | compilers which you thought are impossible |
</pre>
  </body>
</html>

--------------68AA154E086793323F917DC4--




Information forwarded to bug-guix@HIDDEN:
bug#44906; Package guix. Full text available.

Message received at 44906 <at> debbugs.gnu.org:


Received: (at 44906) by debbugs.gnu.org; 27 Nov 2020 23:44:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 27 18:44:48 2020
Received: from localhost ([127.0.0.1]:46624 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kinPz-00065J-Nt
	for submit <at> debbugs.gnu.org; Fri, 27 Nov 2020 18:44:48 -0500
Received: from mail-wr1-f50.google.com ([209.85.221.50]:46815)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1kinPw-000655-VO
 for 44906 <at> debbugs.gnu.org; Fri, 27 Nov 2020 18:44:46 -0500
Received: by mail-wr1-f50.google.com with SMTP id g14so7108553wrm.13
 for <44906 <at> debbugs.gnu.org>; Fri, 27 Nov 2020 15:44:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:subject:in-reply-to:references:date:message-id:mime-version
 :content-transfer-encoding;
 bh=2XbmVIoSLdH5ZVJ6kOSW44NjjG8+xuQIOfP64ToGNJs=;
 b=qtI54843jwXtP+iP8XeiKLSIP7RMpwuDJ+zKMCoLVxmTocla6Otzsk6nB3xENVJZLn
 SUimodHhzFAoU+E8pccFrn2lzyY453jJgLjlCG9gh6YRUwbu0Vn+vmM++nAhL9pUFTdo
 Lo491gOBHinOH1ijAKHCOzs7U2rHs/T5O9RQYz5q9pMRGcJ9rUIW6EstlMof3wIt01Cx
 3qF3jaPVh70KG9sMaq/qKAniz/XvGZbYyFgdeSaXbQdMABZRvYWxSx5iY9LCNy+b1TFa
 P/zSQ5jlN3cTvAxRTkAm9gTnlsk7BilK4xxot7xTYfNMqfO4UrebHdXaDusIxLoz5Qi1
 S9QA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:in-reply-to:references:date
 :message-id:mime-version:content-transfer-encoding;
 bh=2XbmVIoSLdH5ZVJ6kOSW44NjjG8+xuQIOfP64ToGNJs=;
 b=Fp7NyL1WQ4paL50EA3qwSZ1T/2mjfcvtD/CvQ8HoHVZ3893JR2aspdiSfaj3L7Kahg
 Gf34QqaUiGoRf+88BMKeiVN9+zxffu7xsIV7rtB/ilU0SyCBCo4mhnWc1JysiGO7azn+
 JcND+DTAy/rrjNA8SHX23bZRZ2QyllsKdhmsRtEby6Zzx7ebczH85ik8Op1OgTj20rqO
 MUWnnz9fEA8m0nVYJRoL7GrVa59vicXKWOPpLztWA647baxR7o4A0VmJ2HrTx4tJ3kW3
 pQbf6sAGj4jW6mYUfYWtcKGqzF79j5nUrtI9p6r5ayDzQs+M0mESzfVtvzxQy1Kmymb5
 mwxg==
X-Gm-Message-State: AOAM532VxpMigYj+WqLaE7Gb0SO2x6H8171xwo+sBcdiqZcnrk2EMeO8
 o2WsCAikxGeEtPhwGFwPTjRxwBKk9YF4rQ==
X-Google-Smtp-Source: ABdhPJx0ZsrOZ/4HpsTRxPktW0nCSjsOmaL6MejxFl9LJYqKAH+h5AvISmz9wg0WtquTrda3WkDFMA==
X-Received: by 2002:adf:eb91:: with SMTP id t17mr13665240wrn.330.1606520678697; 
 Fri, 27 Nov 2020 15:44:38 -0800 (PST)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id e1sm14653913wmd.16.2020.11.27.15.44.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 27 Nov 2020 15:44:38 -0800 (PST)
From: zimoun <zimon.toutoune@HIDDEN>
To: Hartmut Goebel <h.goebel@HIDDEN>, 44906 <at> debbugs.gnu.org
Subject: Re: bug#44906: Substitute requests fail if URL has trailing slash
In-Reply-To: <3848e5d4-3694-e7f4-cb42-f97a51bde5b4@HIDDEN>
References: <3848e5d4-3694-e7f4-cb42-f97a51bde5b4@HIDDEN>
Date: Sat, 28 Nov 2020 00:37:22 +0100
Message-ID: <86a6v2qslp.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 44906
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Dear,

Thank you for the report.


Tweaking the function such as:

--8<---------------cut here---------------start------------->8---
(define (narinfo-request cache-url path)
  "Return an HTTP request for the narinfo of PATH at CACHE-URL."
  (let ((url (string-append cache-url "/" (store-path-hash-part path)
                            ".narinfo"))
        (headers '((User-Agent . "GNU Guile"))))
    (format #t "~%Narinfo request: ~a~%~%" url)
    (build-request (string->uri url) #:method 'GET #:headers headers)))
--8<---------------cut here---------------end--------------->8---

and removing the cache adequately, then running:

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix weather \
     --substitute-urls=3D"https://ci.guix.gnu.org/ https://ci.guix.gnu.org"=
 \
     hello
computing 1 package derivations for x86_64-linux...

looking for 1 store items on https://ci.guix.gnu.org/...

Narinfo request: https://ci.guix.gnu.org//a462kby1q51ndvxdv3b6p0rsixxrgx1h.=
narinfo

updating substitutes from 'https://ci.guix.gnu.org/'... 100.0%
https://ci.guix.gnu.org/
  0.0% substitutes available (0 out of 1)

[...]

  'https://ci.guix.gnu.org//api/queue?nr=3D1000' returned 400 ("Bad Request=
")

looking for 1 store items on https://ci.guix.gnu.org...

Narinfo request: https://ci.guix.gnu.org/a462kby1q51ndvxdv3b6p0rsixxrgx1h.n=
arinfo

updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
https://ci.guix.gnu.org
  100.0% substitutes available (1 out of 1)

[...]

  at least 1,000 queued builds

[...]

  build rate: 36.89 builds per hour

[...]
--8<---------------cut here---------------end--------------->8---


On Fri, 27 Nov 2020 at 22:19, Hartmut Goebel <h.goebel@HIDDEN>=
 wrote:

> According to RFC 7230, sec 2.7.3 "http and https URI Normalization and
> Comparison" [1]:
>
>    [=E2=80=A6] an empty
>    path component is equivalent to an absolute path of "/", so the
>    normal form is to provide a path of "/" instead.
>
> [1] https://tools.ietf.org/html/rfc7230#section-2.7.3

Now, the question is where should the fix go?  =E2=80=9Cguix publish=E2=80=
=9D exposing
the narinfos or =E2=80=9Cguix weather=E2=80=9C?  Or both?


From my understanding, one fix should go to =E2=80=98guix publish=E2=80=99 =
exposing the
narinfos since:

   https://ci.guix.gnu.org//a462kby1q51ndvxdv3b6p0rsixxrgx1h.narinfo

should be a valid URL and return the narinfo file.  However, taking this
road, it means that the cache folder will not be the same:

~/.cache/guix/substitute/x2wcz6gz3evwlqcrz3fqstmezkfcfnpfb5kfyxbz7kjikc7upk=
iq/
~/.cache/guix/substitute/4refhwxbjmeua2kwg2nmzhv4dg4d3dorpjefq7kiciw2pfhaf2=
6a/

https://ci.guix.gnu.org/ resp. https://ci.guix.gnu.org  Therefore, =E2=80=
=98guix
weather=E2=80=99 should be fixed too.


WDYT?

All the best,
simon




Information forwarded to bug-guix@HIDDEN:
bug#44906; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 27 Nov 2020 21:20:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 27 16:20:03 2020
Received: from localhost ([127.0.0.1]:46343 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kil9u-0006hc-Ez
	for submit <at> debbugs.gnu.org; Fri, 27 Nov 2020 16:20:02 -0500
Received: from lists.gnu.org ([209.51.188.17]:38510)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <h.goebel@HIDDEN>) id 1kil9r-0006hG-F0
 for submit <at> debbugs.gnu.org; Fri, 27 Nov 2020 16:20:00 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:54554)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <h.goebel@HIDDEN>)
 id 1kil9r-0005iY-9j
 for bug-guix@HIDDEN; Fri, 27 Nov 2020 16:19:59 -0500
Received: from mail-out.m-online.net ([2001:a60:0:28:0:1:25:1]:46240)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <h.goebel@HIDDEN>)
 id 1kil9m-0003QX-Ou
 for bug-guix@HIDDEN; Fri, 27 Nov 2020 16:19:59 -0500
Received: from frontend01.mail.m-online.net (unknown [192.168.8.182])
 by mail-out.m-online.net (Postfix) with ESMTP id 4CjSFL3jPWz1rwml
 for <bug-guix@HIDDEN>; Fri, 27 Nov 2020 22:19:50 +0100 (CET)
Received: from localhost (dynscan1.mnet-online.de [192.168.6.70])
 by mail.m-online.net (Postfix) with ESMTP id 4CjSFL3c4Cz1qtmp
 for <bug-guix@HIDDEN>; Fri, 27 Nov 2020 22:19:50 +0100 (CET)
X-Virus-Scanned: amavisd-new at mnet-online.de
Received: from mail.mnet-online.de ([192.168.8.182])
 by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,
 port 10024) with ESMTP id uvbkKENM71Wv for <bug-guix@HIDDEN>;
 Fri, 27 Nov 2020 22:19:48 +0100 (CET)
Received: from hermia.goebel-consult.de
 (ppp-188-174-58-171.dynamic.mnet-online.de [188.174.58.171])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mail.mnet-online.de (Postfix) with ESMTPS
 for <bug-guix@HIDDEN>; Fri, 27 Nov 2020 22:19:48 +0100 (CET)
Received: from thisbe.goebel-consult.de (lenashee.goebel-consult.de
 [192.168.110.2])
 by hermia.goebel-consult.de (Postfix) with ESMTP id 667F86028B
 for <bug-guix@HIDDEN>; Fri, 27 Nov 2020 22:19:49 +0100 (CET)
To: bug-guix <bug-guix@HIDDEN>
From: Hartmut Goebel <h.goebel@HIDDEN>
Organization: crazy-compilers.com
Subject: Substitute requests fail if URL has trailing slash
Message-ID: <3848e5d4-3694-e7f4-cb42-f97a51bde5b4@HIDDEN>
Date: Fri, 27 Nov 2020 22:19:45 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
 Thunderbird/68.12.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Language: en-US
Received-SPF: none client-ip=2001:a60:0:28:0:1:25:1;
 envelope-from=h.goebel@HIDDEN; helo=mail-out.m-online.net
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

If the substitute-URL ends with a slash, api requests fail.

Expected behavior:

Substitute-URLs with and without trailing slash should behave the same.
This is especially true for substitute-URLs with empty path
("http://server") and path "/" (http://server/") - for which the RFCs
explicitly state to be equivalent.

According to RFC 7230, sec 2.7.3 "http and https URI Normalization and
Comparison" [1]:

   […] an empty
   path component is equivalent to an absolute path of "/", so the
   normal form is to provide a path of "/" instead.

[1] https://tools.ietf.org/html/rfc7230#section-2.7.3


How to reproduce:

no trailing slash:

$ guix weather --substitute-urls="https://ci.guix.gnu.org" gcc-toolchain
…
https://ci.guix.gnu.org
  100.0% substitutes available (3 out of 3)
…

Trailing slash:

$ guix weather --substitute-urls="https://ci.guix.gnu.org/" gcc-toolchain
…
https://ci.guix.gnu.org/
  0.0% substitutes available (0 out of 3)
…
  'https://ci.guix.gnu.org//api/queue?nr=1000' returned 400 ("Bad Request")

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@HIDDEN               |
| www.crazy-compilers.com | compilers which you thought are impossible |





Acknowledgement sent to Hartmut Goebel <h.goebel@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#44906; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 3 Dec 2020 17:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.