close request body

This commit is contained in:
Richard van der Hoff 2017-12-04 12:49:48 +00:00
parent 5fac31b9b4
commit 92e9797fe9

View file

@ -83,6 +83,10 @@ type submitResponse struct {
}
func (s *submitServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
// if we attempt to return a response without reading the request body,
// haproxy gets upset and returns a 500. Let's try this.
defer req.Body.Close()
if req.Method != "POST" && req.Method != "OPTIONS" {
respond(405, w)
return