commit 497297b5a0c91c16a38dd00bc40be7de16971d6a
parent fb2ec4e2c13f3f2fbbc56e4d11ea6f28a93925ef
Author: Daniel Barlow <dan@telent.net>
Date: Wed, 5 Aug 2026 23:31:08 +0100
json-to-fstree: Accept: application/json
this is required for undercroft which will otherwise serve yaml, but
I think is not going to hurt for any other server either
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pkgs/json-to-fstree/json-to-fstree.fnl b/pkgs/json-to-fstree/json-to-fstree.fnl
@@ -1,11 +1,12 @@
(local json (require :json))
(local http (require :fetch))
(local svc (require :anoia.svc))
-(local { : utime } (require :lualinux))
+(local { : setenv : utime } (require :lualinux))
(fn download [url dest]
(let [state (.. dest "/state")
previously (ll.lstat state 12)]
+ (setenv "HTTP_ACCEPT" "application/json")
(match (http.fetch url "i" previously)
(nil 10 _) ; not modified
(print (.. url " not modified, already up to date"))