prevent caching of HEAD responses
This commit is contained in:
parent
30b913d544
commit
0c04ba220f
|
@ -258,6 +258,7 @@ func (handler *Handler) headFile(w http.ResponseWriter, r *http.Request) {
|
|||
w.Header().Set("Upload-Metadata", serializeMeta(info.MetaData))
|
||||
}
|
||||
|
||||
w.Header().Set("Cache-Control", "no-store")
|
||||
w.Header().Set("Upload-Length", strconv.FormatInt(info.Size, 10))
|
||||
w.Header().Set("Upload-Offset", strconv.FormatInt(info.Offset, 10))
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
|
|
|
@ -43,6 +43,7 @@ func TestHead(t *testing.T) {
|
|||
"Upload-Offset": "11",
|
||||
"Upload-Length": "44",
|
||||
"Upload-Metadata": "name bHVucmpzLnBuZw==,type aW1hZ2UvcG5n",
|
||||
"Cache-Control": "no-store",
|
||||
},
|
||||
}).Run(handler, t)
|
||||
|
||||
|
|
Loading…
Reference in New Issue