From 05c466094e5bed350be160f9318e5bbdca8ee21c Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 4 Mar 2024 13:35:17 +0100 Subject: [PATCH] Expose the executable bit into a HTTP header --- api/unpack/index.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/unpack/index.go b/api/unpack/index.go index 022f619..bf5b5ca 100644 --- a/api/unpack/index.go +++ b/api/unpack/index.go @@ -164,7 +164,10 @@ func Handler(w http.ResponseWriter, req *http.Request) { // TODO: use http.DetectContentType as a fallback } - w.Header().Set("Cache-Control", "immutable") + if hdr.Executable { + w.Header().Set("NAR-Executable", "1") + } + w.Header().Set("Content-Type", ctype) w.Header().Set("Content-Length", fmt.Sprintf("%d", hdr.Size)) if req.Method != "HEAD" {