diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2022-05-18 10:59:07 -0600 |
---|---|---|
committer | Brian Picciano <mediocregopher@gmail.com> | 2022-05-18 10:59:07 -0600 |
commit | 56530a8a66937194fb4e99af95bcea6bb0281f66 (patch) | |
tree | 9546829e36ac35a0daaed33d2f0ffc73fa85f4ad /srv/src/api/apiutil | |
parent | 69de76cb32cfd638672d4d5846d0659bf102316f (diff) |
Implement asset deletion and fix redirect logic
Diffstat (limited to 'srv/src/api/apiutil')
-rw-r--r-- | srv/src/api/apiutil/apiutil.go | 8 |
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) |