From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 29 00:19:19 2021 Received: (at 51441) by debbugs.gnu.org; 29 Oct 2021 04:19:19 +0000 Received: from localhost ([127.0.0.1]:53732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgJMN-00071Y-LD for submit@debbugs.gnu.org; Fri, 29 Oct 2021 00:19:19 -0400 Received: from mx1.riseup.net ([198.252.153.129]:33636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgJMJ-00071I-Ry for 51441@debbugs.gnu.org; Fri, 29 Oct 2021 00:19:17 -0400 Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4HgThZ2Y8tzDqtC; Thu, 28 Oct 2021 21:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1635481150; bh=rEEQFQiSOxNbgnEUUX4f6lsU0NKBOq5SPLpsv5jXdWM=; h=References:From:To:Cc:Subject:In-reply-to:Date:From; b=rGSpLI1ii162DQrmtRVbXpAKvVpy9NwsQu6bPmkbZerdWNg9pmT+6NrOvaAI+XK5y ikFQIq92vYrZPK8S2YYMy/M0ex0HlsKIydNQwGem6OThZ13BmMVvbwQNsXzEZuVmBE PGCvsrMLbMnttTATWli5IhGkjE0LQ6hwVkNiFRfI= X-Riseup-User-ID: E6CD0B6F0FE2F72FD096C75181AB5B7662F472F1DFA5A39D4CABEFB0DB5728EC Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4HgThY31yrz1xqF; Thu, 28 Oct 2021 21:19:09 -0700 (PDT) Received: from localhost (dinosaur [local]) by dinosaur (OpenSMTPD) with ESMTPA id 6898a79d; Fri, 29 Oct 2021 04:18:52 +0000 (UTC) References: From: Peng Mei Yu To: Z572 <873216071@qq.com> Subject: Re: [bug#51441] [PATCH] substitutes: keep base's uri-path for Properly construct URL. In-reply-to: Date: Fri, 29 Oct 2021 12:18:52 +0800 Message-ID: <8735ok31lf.fsf@xqzp.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 51441 Cc: 51441@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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. -- Peng Mei Yu