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 #14 received at 44906 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 44906 <at> debbugs.gnu.org, zimoun <zimon.toutoune <at> gmail.com>
Subject: Re: bug#44906: Substitute requests fail if URL has trailing slash
Date: Thu, 03 Dec 2020 18:01:05 +0100
Hi,

Hartmut Goebel <h.goebel <at> crazy-compilers.com> 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 
> 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);

To begin with, we could define ‘url-append’ in (guix http-client), say,
and use it in (guix scripts substitute).

Eventually it would be nice to have that in (web uri).

Thoughts?

Ludo’.




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.