Fixed "Tus-Resumable" header check for HEAD request.
Signed-off-by: Pavel Kirilin <win10@list.ru>
This commit is contained in:
parent
d560c4e753
commit
bea5183ec3
|
@ -262,7 +262,7 @@ func (handler *UnroutedHandler) Middleware(h http.Handler) http.Handler {
|
||||||
// Test if the version sent by the client is supported
|
// Test if the version sent by the client is supported
|
||||||
// GET methods are not checked since a browser may visit this URL and does
|
// GET methods are not checked since a browser may visit this URL and does
|
||||||
// not include this header. This request is not part of the specification.
|
// not include this header. This request is not part of the specification.
|
||||||
if r.Method != "GET" && r.Header.Get("Tus-Resumable") != "1.0.0" {
|
if r.Method != "GET" && r.Method != "HEAD" && r.Header.Get("Tus-Resumable") != "1.0.0" {
|
||||||
handler.sendError(w, r, ErrUnsupportedVersion)
|
handler.sendError(w, r, ErrUnsupportedVersion)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -472,6 +472,7 @@ func (handler *UnroutedHandler) HeadFile(w http.ResponseWriter, r *http.Request)
|
||||||
w.Header().Set("Upload-Defer-Length", UploadLengthDeferred)
|
w.Header().Set("Upload-Defer-Length", UploadLengthDeferred)
|
||||||
} else {
|
} else {
|
||||||
w.Header().Set("Upload-Length", strconv.FormatInt(info.Size, 10))
|
w.Header().Set("Upload-Length", strconv.FormatInt(info.Size, 10))
|
||||||
|
w.Header().Set("Content-Length", strconv.FormatInt(info.Size, 10))
|
||||||
}
|
}
|
||||||
|
|
||||||
w.Header().Set("Cache-Control", "no-store")
|
w.Header().Set("Cache-Control", "no-store")
|
||||||
|
|
Loading…
Reference in New Issue