Fix fetching nar files with a .json extension
Previously, the .json extension would be stripped, resulting in a 404, this fixes that.
This commit is contained in:
parent
b6754c8a4c
commit
f8de7cf42e
1 changed files with 20 additions and 10 deletions
|
|
@ -70,16 +70,26 @@
|
||||||
(('GET "substitutes")
|
(('GET "substitutes")
|
||||||
(render-html
|
(render-html
|
||||||
#:sxml (view-substitutes (%narinfo-signing-public-key))))
|
#:sxml (view-substitutes (%narinfo-signing-public-key))))
|
||||||
(('GET "nar" file-name)
|
(('GET "nar" _)
|
||||||
(render-nar request
|
;; These routes are a little special, as the extensions aren't used for
|
||||||
mime-types
|
;; content negotiation, so just use the path from the request
|
||||||
conn
|
(let* ((path (uri-path (request-uri request)))
|
||||||
(string-append "/gnu/store/" file-name)))
|
(file-name
|
||||||
(('GET "nar" "lzip" file-name)
|
(last (string-split path #\/))))
|
||||||
(render-lzip-nar request
|
(render-nar request
|
||||||
mime-types
|
mime-types
|
||||||
conn
|
conn
|
||||||
(string-append "/gnu/store/" file-name)))
|
(string-append "/gnu/store/" file-name))))
|
||||||
|
(('GET "nar" "lzip" _)
|
||||||
|
;; These routes are a little special, as the extensions aren't used for
|
||||||
|
;; content negotiation, so just use the path from the request
|
||||||
|
(let* ((path (uri-path (request-uri request)))
|
||||||
|
(file-name
|
||||||
|
(last (string-split path #\/))))
|
||||||
|
(render-lzip-nar request
|
||||||
|
mime-types
|
||||||
|
conn
|
||||||
|
(string-append "/gnu/store/" file-name))))
|
||||||
(('GET (? .narinfo-suffix path))
|
(('GET (? .narinfo-suffix path))
|
||||||
(render-narinfo request
|
(render-narinfo request
|
||||||
conn
|
conn
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue