unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Peng Mei Yu <pengmeiyu@riseup.net>
Cc: Z572 <873216071@qq.com>, 51441-done@debbugs.gnu.org
Subject: bug#51441: [PATCH] substitutes: keep base's uri-path for Properly construct URL.
Date: Sun, 12 Dec 2021 00:34:36 +0100	[thread overview]
Message-ID: <87sfuy4sxf.fsf_-_@gnu.org> (raw)
In-Reply-To: <8735ok31lf.fsf@xqzp.net> (Peng Mei Yu's message of "Fri, 29 Oct 2021 12:18:52 +0800")

Hi,

Peng Mei Yu <pengmeiyu@riseup.net> skribis:

> Z572 via Guix-patches via writes:
>
>> @@ -158,7 +159,8 @@ (define (narinfo-request cache-url path)
>>    "Return an HTTP request for the narinfo of PATH at CACHE-URL."
>>    (let* ((base (string->uri cache-url))
>>           (ref (build-relative-ref
>> -               #:path (string-append (store-path-hash-part path) ".narinfo")))
>> +               #:path (string-append (uri-path base) "/"
>> +                                     (store-path-hash-part path) ".narinfo")))
>>           (url (resolve-uri-reference ref base))
>>           (headers '((User-Agent . "GNU Guile"))))
>>      (build-request url #:method 'GET #:headers headers)))
>> --
>
> It seems that the root cause for the problem is that cache-url lacks a
> trailing slash.  Therefore the last path component is stripped from
> `base` when we compute (resolve-uri-reference ref base).  So I think
> ensuring cache-url ends with a slash ("/") is a better approach.

Indeed.  I’ve implemented your suggestion in
e68466de122d94ac3fa75aae234cd5fd89482a5a, and commit
cba0395c99005f94e4ccd6c058362af7443dab12 makes a related adjustment.

Note that we still need to update the ‘guix’ package so you can benefit
from the bug fix.  In the meantime you have to pass that trailing slash.

Thank you, and sorry for the delay!

Ludo’.




  parent reply	other threads:[~2021-12-11 23:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 13:53 [bug#51441] [PATCH] substitutes: keep base's uri-path for Properly construct URL Z572 via Guix-patches via
     [not found] ` <87fssmwhcc.fsf@qq.com>
2021-10-27 16:37   ` Z572 via Guix-patches via
2021-10-29  1:48   ` Z572 via Guix-patches via
2021-10-29  4:18 ` Peng Mei Yu
     [not found]   ` <87a6is4ff8.fsf@qq.com>
2021-10-29  4:33     ` Z572 via Guix-patches via
2021-12-11 23:34   ` Ludovic Courtès [this message]
2021-11-10 11:30 ` Zhu Zihao

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=87sfuy4sxf.fsf_-_@gnu.org \
    --to=ludo@gnu.org \
    --cc=51441-done@debbugs.gnu.org \
    --cc=873216071@qq.com \
    --cc=pengmeiyu@riseup.net \
    /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).