prevent caching of HEAD responses

This commit is contained in:
Acconut 2015-05-26 16:17:35 +02:00
parent 30b913d544
commit 0c04ba220f
2 changed files with 2 additions and 0 deletions

View File

@ -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)

View File

@ -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)