diff options
Diffstat (limited to 'srv/src/http/apiutil')
-rw-r--r-- | srv/src/http/apiutil/apiutil.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/srv/src/http/apiutil/apiutil.go b/srv/src/http/apiutil/apiutil.go index d427b65..aa62299 100644 --- a/srv/src/http/apiutil/apiutil.go +++ b/srv/src/http/apiutil/apiutil.go @@ -121,10 +121,11 @@ func MethodMux(handlers map[string]http.Handler) http.Handler { return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - method := strings.ToUpper(r.FormValue("method")) + method := strings.ToUpper(r.Method) + formMethod := strings.ToUpper(r.FormValue("method")) - if method == "" { - method = strings.ToUpper(r.Method) + if method == "POST" && formMethod != "" { + method = formMethod } handler, ok := handlers[method] |