From 642c834ada9eca3e4bad2cd4311a54c7d55e01be Mon Sep 17 00:00:00 2001 From: David Hill Date: Fri, 7 Feb 2014 20:59:20 -0500 Subject: [PATCH] move Connection header so it is applied to failed authentication attempts as well. ok @davecgh --- rpcserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcserver.go b/rpcserver.go index a0b96374c..4c1b339a6 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -166,11 +166,11 @@ func (s *rpcServer) Start() { ReadTimeout: time.Second * rpcAuthTimeoutSeconds, } rpcServeMux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Connection", "close") if _, err := s.checkAuth(r, true); err != nil { jsonAuthFail(w, r, s) return } - w.Header().Set("Connection", "close") jsonRPCRead(w, r, s) })