guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#51441: [PATCH] substitutes: keep base's uri-path for Properly constr


From: Ludovic Courtès
Subject: bug#51441: [PATCH] substitutes: keep base's uri-path for Properly construct URL.
Date: Sun, 12 Dec 2021 00:34:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]