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 `(tr
(td (samp ,system)) (td (samp ,system))
(td (samp ,target)) (td (samp ,target))
(td (a (@ (href ,file-name)) (td (a (@ (href ,(uri-encode-filename file-name)))
,(display-store-item-short file-name))) ,(display-store-item-short file-name)))
(td (td
(ul (ul

View file

@ -29,7 +29,9 @@
hyphenate-words hyphenate-words
remove-brackets remove-brackets
underscore-join-words)) underscore-join-words
uri-encode-filename))
(define (most-appropriate-mime-type accepted-mime-types (define (most-appropriate-mime-type accepted-mime-types
supported-mime-types) supported-mime-types)
@ -112,3 +114,9 @@
(string-join (string-join
(string-split words #\space) (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: ") (h4 "Derivation: ")
,(match derivation ,(match derivation
((file-name output-id) ((file-name output-id)
`(a (@ (href ,file-name)) `(a (@ (href ,(uri-encode-filename file-name)))
,(display-store-item file-name)))))))) ,(display-store-item file-name))))))))
derivations))))) derivations)))))
@ -623,7 +623,8 @@
,@(map (match-lambda ,@(map (match-lambda
((derivation-file-name outputs) ((derivation-file-name outputs)
`(tr `(tr
(td (a (@ (href ,derivation-file-name)) (td (a (@ (href ,(uri-encode-filename
derivation-file-name)))
,(display-store-item-short derivation-file-name)))))) ,(display-store-item-short derivation-file-name))))))
derivation-inputs))))) derivation-inputs)))))
(div (div
@ -683,10 +684,7 @@
,@(map (match-lambda ,@(map (match-lambda
((output-name path hash-algorithm hash recursive?) ((output-name path hash-algorithm hash recursive?)
`(tr `(tr
(td (a (@ (href ,(string-join (td (a (@ (href ,(uri-encode-filename path)))
(map uri-encode
(string-split path #\/))
"/")))
,(display-store-item-short path)))))) ,(display-store-item-short path))))))
derivation-outputs))))))))) derivation-outputs)))))))))