From 613527db25c33e0a74de562d1b526e846757a4d6 Mon Sep 17 00:00:00 2001 From: Naren Venkataraman Date: Sun, 1 Nov 2015 19:50:10 -0500 Subject: [PATCH] Make sure HEAD requests don't Hang when tus version header is missing/incorrect --- handler.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/handler.go b/handler.go index e46de68..77087d9 100644 --- a/handler.go +++ b/handler.go @@ -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 // not include this header. This request is not part of the specification. 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 }