Make sure HEAD requests don't Hang when tus version header is missing/incorrect
This commit is contained in:
parent
4c59ae42b7
commit
613527db25
|
@ -168,7 +168,8 @@ func (handler *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
// 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.Header.Get("Tus-Resumable") != "1.0.0" {
|
||||||
handler.sendError(w, ErrUnsupportedVersion)
|
header.Set("Content-Length", "0")
|
||||||
|
w.WriteHeader(http.StatusPreconditionFailed)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue