summaryrefslogtreecommitdiff
path: root/srv/src/api/apiutil/apiutil.go
diff options
context:
space:
mode:
Diffstat (limited to 'srv/src/api/apiutil/apiutil.go')
-rw-r--r--srv/src/api/apiutil/apiutil.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/srv/src/api/apiutil/apiutil.go b/srv/src/api/apiutil/apiutil.go
index f7830ae..d427b65 100644
--- a/srv/src/api/apiutil/apiutil.go
+++ b/srv/src/api/apiutil/apiutil.go
@@ -121,7 +121,13 @@ func MethodMux(handlers map[string]http.Handler) http.Handler {
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
- handler, ok := handlers[strings.ToUpper(r.Method)]
+ method := strings.ToUpper(r.FormValue("method"))
+
+ if method == "" {
+ method = strings.ToUpper(r.Method)
+ }
+
+ handler, ok := handlers[method]
if !ok {
http.Error(rw, "Method not allowed", http.StatusMethodNotAllowed)