Commit c72d6725 authored by ginuerzh's avatar ginuerzh Committed by GitHub

Merge pull request #121 from messyidea/master

add "Proxy-Authenticate" header for http2
parents aa075e66 bd0f9869
...@@ -211,6 +211,7 @@ func (s *Http2Server) HandleRequest(w http.ResponseWriter, req *http.Request) { ...@@ -211,6 +211,7 @@ func (s *Http2Server) HandleRequest(w http.ResponseWriter, req *http.Request) {
} }
if len(s.Base.Node.Users) > 0 && !valid { if len(s.Base.Node.Users) > 0 && !valid {
glog.V(LWARNING).Infof("[http2] %s <- %s : proxy authentication required", req.RemoteAddr, target) 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) w.WriteHeader(http.StatusProxyAuthRequired)
return return
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment