From: "Ludovic Courtès" <ludo@gnu.org>
To: Hartmut Goebel <h.goebel@crazy-compilers.com>
Cc: 44906@debbugs.gnu.org
Subject: bug#44906: Substitute requests fail if URL has trailing slash
Date: Thu, 03 Dec 2020 18:01:05 +0100 [thread overview]
Message-ID: <87im9iddta.fsf@gnu.org> (raw)
In-Reply-To: <7b367712-d759-ba3d-3ffc-d3323cb859c7@crazy-compilers.com> (Hartmut Goebel's message of "Sat, 28 Nov 2020 10:47:31 +0100")
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’.
next prev parent reply other threads:[~2020-12-03 17:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-27 21:19 bug#44906: Substitute requests fail if URL has trailing slash Hartmut Goebel
2020-11-27 23:37 ` zimoun
2020-11-28 9:47 ` Hartmut Goebel
2020-12-03 17:01 ` Ludovic Courtès [this message]
2020-12-04 4:15 ` Mark H Weaver
2021-07-09 8:38 ` bug#44906: [PATCH 0/3] Properly construct URLs if base-url " Hartmut Goebel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87im9iddta.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=44906@debbugs.gnu.org \
--cc=h.goebel@crazy-compilers.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).