Skip to content

Commit

Permalink
Expose the executable bit into a HTTP header
Browse files Browse the repository at this point in the history
  • Loading branch information
stv0g committed Mar 4, 2024
1 parent 91c6682 commit 05c4660
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/unpack/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit 05c4660

Please sign in to comment.