Don't crash on 405 here - fix null deref of http.

This commit is contained in:
Auke Kok 2018-01-25 23:07:54 -08:00
parent 46a398e079
commit 162f259a73

View File

@ -73,7 +73,7 @@ func (s FastCGIServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
if req.Method != "POST" {
w.Header().Set("Access-Control-Allow-Headers", "POST")
http.Error(w, err.Error(), http.StatusMethodNotAllowed)
http.Error(w, err.Error(), 405)
log.Printf("Invalid GET from %v\n", remoteip)
return
}