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


View this message in rfc822 format

From: Mark H Weaver <mhw <at> netris.org>
To: Ludovic Courtès <ludo <at> gnu.org>, Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 44906 <at> debbugs.gnu.org
Subject: bug#44906: Substitute requests fail if URL has trailing slash
Date: Thu, 03 Dec 2020 23:15:45 -0500
Hi,

Ludovic Courtès <ludo <at> gnu.org> writes:

> 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).

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




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.