unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44906: Substitute requests fail if URL has trailing slash
@ 2020-11-27 21:19 Hartmut Goebel
  2020-11-27 23:37 ` zimoun
  0 siblings, 1 reply; 6+ messages in thread
From: Hartmut Goebel @ 2020-11-27 21:19 UTC (permalink / raw)
  To: 44906

If the substitute-URL ends with a slash, api requests fail.

Expected behavior:

Substitute-URLs with and without trailing slash should behave the same.
This is especially true for substitute-URLs with empty path
("http://server") and path "/" (http://server/") - for which the RFCs
explicitly state to be equivalent.

According to RFC 7230, sec 2.7.3 "http and https URI Normalization and
Comparison" [1]:

   […] an empty
   path component is equivalent to an absolute path of "/", so the
   normal form is to provide a path of "/" instead.

[1] https://tools.ietf.org/html/rfc7230#section-2.7.3


How to reproduce:

no trailing slash:

$ guix weather --substitute-urls="https://ci.guix.gnu.org" gcc-toolchain
…
https://ci.guix.gnu.org
  100.0% substitutes available (3 out of 3)
…

Trailing slash:

$ guix weather --substitute-urls="https://ci.guix.gnu.org/" gcc-toolchain
…
https://ci.guix.gnu.org/
  0.0% substitutes available (0 out of 3)
…
  'https://ci.guix.gnu.org//api/queue?nr=1000' returned 400 ("Bad Request")

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-07-09  8:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-07-09  8:38         ` bug#44906: [PATCH 0/3] Properly construct URLs if base-url " Hartmut Goebel

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