[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#44906: Substitute requests fail if URL has trailing slash
From: |
Ludovic Courtès |
Subject: |
bug#44906: Substitute requests fail if URL has trailing slash |
Date: |
Thu, 03 Dec 2020 18:01:05 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Hi,
Hartmut Goebel <h.goebel@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’.
- bug#44906: Substitute requests fail if URL has trailing slash,
Ludovic Courtès <=