summaryrefslogtreecommitdiff
path: root/guix/scripts/publish.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-06-08 18:59:25 +0200
committerLudovic Courtès <ludo@gnu.org>2016-06-08 19:07:58 +0200
commit93961f02987cf738d116cc85cc32d97c2a488222 (patch)
tree47cc031b698ec91833c7a5de9a3e9d0428130039 /guix/scripts/publish.scm
parentdc794a723809f0f28e49e4c32e8974b5b9a98ff0 (diff)
publish: Encore URIs that appear in narinfos.
Fixes <http://bugs.gnu.org/21888>. 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.
Diffstat (limited to 'guix/scripts/publish.scm')
-rw-r--r--guix/scripts/publish.scm3
1 files changed, 2 insertions, 1 deletions
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))