rpc: add explicit 200 response for empty HTTP GET (#20952)

This commit is contained in:
Steven E. Harris
2020-04-28 04:43:21 -04:00
committed by GitHub
parent 1893266c59
commit 9887edd580
2 changed files with 57 additions and 10 deletions

View File

@ -208,6 +208,7 @@ func (t *httpServerConn) SetWriteDeadline(time.Time) error { return nil }
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// Permit dumb empty requests for remote health-checks (AWS)
if r.Method == http.MethodGet && r.ContentLength == 0 && r.URL.RawQuery == "" {
w.WriteHeader(http.StatusOK)
return
}
if code, err := validateRequest(r); err != nil {