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

Previous Next

Package: guix;

Reported by: Hartmut Goebel <h.goebel <at> crazy-compilers.com>

Date: Fri, 27 Nov 2020 21:21:02 UTC

Severity: normal

Fixed in versions 49483, 49482

Done: Hartmut Goebel <h.goebel <at> goebel-consult.de>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 44906 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: zimoun <zimon.toutoune <at> gmail.com>, 44906 <at> debbugs.gnu.org
Subject: Re: bug#44906: Substitute requests fail if URL has trailing slash
Date: Sat, 28 Nov 2020 10:47:31 +0100
[Message part 1 (text/plain, inline)]
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 <at> crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

[Message part 2 (text/html, inline)]

This bug report was last modified 3 years and 312 days ago.

Previous Next


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