unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: "Ludovic Courtès" <ludo@gnu.org>,
	"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 23:15:45 -0500	[thread overview]
Message-ID: <87zh2udx4j.fsf@netris.org> (raw)
In-Reply-To: <87im9iddta.fsf@gnu.org>

Hi,

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

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

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




  reply	other threads:[~2020-12-04  4:17 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
2020-12-04  4:15       ` Mark H Weaver [this message]
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=87zh2udx4j.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=44906@debbugs.gnu.org \
    --cc=h.goebel@crazy-compilers.com \
    --cc=ludo@gnu.org \
    /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).