Fix some URL encoding issues around derivation names

This commit is contained in:
Christopher Baines 2022-01-31 20:27:11 +00:00
parent 86cd96ea87
commit 8ed53099ba
3 changed files with 14 additions and 8 deletions

View file

@ -300,7 +300,7 @@
`(tr
(td (samp ,system))
(td (samp ,target))
(td (a (@ (href ,file-name))
(td (a (@ (href ,(uri-encode-filename file-name)))
,(display-store-item-short file-name)))
(td
(ul

View file

@ -29,7 +29,9 @@
hyphenate-words
remove-brackets
underscore-join-words))
underscore-join-words
uri-encode-filename))
(define (most-appropriate-mime-type accepted-mime-types
supported-mime-types)
@ -112,3 +114,9 @@
(string-join
(string-split words #\space)
"_"))
(define (uri-encode-filename s)
(string-join
(map uri-encode
(string-split s #\/))
"/"))

View file

@ -537,7 +537,7 @@
(h4 "Derivation: ")
,(match derivation
((file-name output-id)
`(a (@ (href ,file-name))
`(a (@ (href ,(uri-encode-filename file-name)))
,(display-store-item file-name))))))))
derivations)))))
@ -623,7 +623,8 @@
,@(map (match-lambda
((derivation-file-name outputs)
`(tr
(td (a (@ (href ,derivation-file-name))
(td (a (@ (href ,(uri-encode-filename
derivation-file-name)))
,(display-store-item-short derivation-file-name))))))
derivation-inputs)))))
(div
@ -683,10 +684,7 @@
,@(map (match-lambda
((output-name path hash-algorithm hash recursive?)
`(tr
(td (a (@ (href ,(string-join
(map uri-encode
(string-split path #\/))
"/")))
(td (a (@ (href ,(uri-encode-filename path)))
,(display-store-item-short path))))))
derivation-outputs)))))))))