[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#44906: Substitute requests fail if URL has trailing slash
From: |
Hartmut Goebel |
Subject: |
bug#44906: Substitute requests fail if URL has trailing slash |
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 |
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@crazy-compilers.com |
| www.crazy-compilers.com | compilers which you thought are impossible |