From 93961f02987cf738d116cc85cc32d97c2a488222 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 8 Jun 2016 18:59:25 +0200 Subject: publish: Encore URIs that appear in narinfos. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . Reported by iyzsong@member.fsf.org (宋文武). * guix/scripts/publish.scm (narinfo-string): Use 'encode-and-join-uri-path' instead of 'string-append' to compute URL. * tests/publish.scm ("/*.narinfo with properly encoded '+' sign"): ("/nar/ with properly encoded '+' sign"): New tests. --- guix/scripts/publish.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm index 46292131d7..ddb579bb17 100644 --- a/guix/scripts/publish.scm +++ b/guix/scripts/publish.scm @@ -146,7 +146,8 @@ Publish ~a over HTTP.\n") %store-directory) "Generate a narinfo key/value string for STORE-PATH; an exception is raised if STORE-PATH is invalid. The narinfo is signed with KEY." (let* ((path-info (query-path-info store store-path)) - (url (string-append "nar/" (basename store-path))) + (url (encode-and-join-uri-path (list "nar" + (basename store-path)))) (hash (bytevector->nix-base32-string (path-info-hash path-info))) (size (path-info-nar-size path-info)) -- cgit v1.2.3