From bd0f9869c76952863c59bcb101af86c448df2523 Mon Sep 17 00:00:00 2001 From: messyidea Date: Fri, 14 Jul 2017 13:30:08 +0800 Subject: [PATCH] add "Proxy-Authenticate" header for http2 --- http.go | 1 + 1 file changed, 1 insertion(+) diff --git a/http.go b/http.go index b9f7e4e..5ad16fb 100644 --- a/http.go +++ b/http.go @@ -211,6 +211,7 @@ func (s *Http2Server) HandleRequest(w http.ResponseWriter, req *http.Request) { } if len(s.Base.Node.Users) > 0 && !valid { glog.V(LWARNING).Infof("[http2] %s <- %s : proxy authentication required", req.RemoteAddr, target) + w.Header().Set("Proxy-Authenticate", "Basic realm=\"gost\"") w.WriteHeader(http.StatusProxyAuthRequired) return }