Respond with the correct 200 OK code for HEAD requests

Fixes #48
This commit is contained in:
Marius 2016-08-28 15:26:12 +02:00
parent 3eefdbe2c6
commit 6b1e8a8bda
3 changed files with 4 additions and 4 deletions

View File

@ -69,7 +69,7 @@ func TestConcatPartial(t *testing.T) {
ReqHeader: map[string]string{
"Tus-Resumable": "1.0.0",
},
Code: http.StatusNoContent,
Code: http.StatusOK,
ResHeader: map[string]string{
"Upload-Concat": "partial",
},
@ -165,7 +165,7 @@ func TestConcatFinal(t *testing.T) {
ReqHeader: map[string]string{
"Tus-Resumable": "1.0.0",
},
Code: http.StatusNoContent,
Code: http.StatusOK,
ResHeader: map[string]string{
"Upload-Concat": "final; http://tus.io/files/a http://tus.io/files/b",
"Upload-Length": "10",

View File

@ -40,7 +40,7 @@ func TestHead(t *testing.T) {
ReqHeader: map[string]string{
"Tus-Resumable": "1.0.0",
},
Code: http.StatusNoContent,
Code: http.StatusOK,
ResHeader: map[string]string{
"Upload-Offset": "11",
"Upload-Length": "44",

View File

@ -313,7 +313,7 @@ func (handler *UnroutedHandler) HeadFile(w http.ResponseWriter, r *http.Request)
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)
w.WriteHeader(http.StatusOK)
}
// PatchFile adds a chunk to an upload. Only allowed enough space is left.