GNU bug report logs - #51441
[PATCH] substitutes: keep base's uri-path for Properly construct URL.

Previous Next

Package: guix-patches;

Reported by: Z572 <873216071 <at> qq.com>

Date: Wed, 27 Oct 2021 14:12:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 51441 <at> debbugs.gnu.org (full text, mbox):

From: Z572 <873216071 <at> qq.com>
To: Peng Mei Yu <pengmeiyu <at> riseup.net>
Cc: 51441 <at> debbugs.gnu.org
Subject: Re: [bug#51441] [PATCH] substitutes: keep base's uri-path for
 Properly construct URL.
Date: Fri, 29 Oct 2021 12:33:42 +0800
Peng Mei Yu <pengmeiyu <at> riseup.net> writes:

> Hi,
>
> 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.

Yes, you are right.

-- 
over




This bug report was last modified 3 years and 159 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.