From c22e941b8aa783178b6341ec63c83ab16177677a Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 29 Nov 2010 03:56:57 +0000 Subject: [PATCH] Work around http://code.google.com/p/go/issues/detail?id=1306 --- server/go/auth/auth.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server/go/auth/auth.go b/server/go/auth/auth.go index 472164394..5711d539d 100644 --- a/server/go/auth/auth.go +++ b/server/go/auth/auth.go @@ -42,6 +42,7 @@ func IsAuthorized(req *http.Request) bool { func RequireAuth(handler func(conn http.ResponseWriter, req *http.Request)) func (conn http.ResponseWriter, req *http.Request) { return func (conn http.ResponseWriter, req *http.Request) { if !IsAuthorized(req) { + req.Body.Close() // http://code.google.com/p/go/issues/detail?id=1306 conn.SetHeader("WWW-Authenticate", "Basic realm=\"camlistored\"") conn.WriteHeader(http.StatusUnauthorized) fmt.Fprintf(conn, "Authentication required.\n")