mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-14 10:06:40 +00:00
move Connection header so it is applied to failed authentication
attempts as well. ok @davecgh
This commit is contained in:
parent
476000193f
commit
642c834ada
@ -166,11 +166,11 @@ func (s *rpcServer) Start() {
|
|||||||
ReadTimeout: time.Second * rpcAuthTimeoutSeconds,
|
ReadTimeout: time.Second * rpcAuthTimeoutSeconds,
|
||||||
}
|
}
|
||||||
rpcServeMux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
rpcServeMux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.Header().Set("Connection", "close")
|
||||||
if _, err := s.checkAuth(r, true); err != nil {
|
if _, err := s.checkAuth(r, true); err != nil {
|
||||||
jsonAuthFail(w, r, s)
|
jsonAuthFail(w, r, s)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
w.Header().Set("Connection", "close")
|
|
||||||
jsonRPCRead(w, r, s)
|
jsonRPCRead(w, r, s)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user