From 8ac32ed27c61777ade0d9485c89bf25155fd1ed1 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Tue, 6 Aug 2019 15:45:30 +0300 Subject: [PATCH] minor, relative to: https://github.com/kataras/iris/issues/1325 Former-commit-id: 9febac1ba701b29e59d7660540f03217f12cf9e0 --- middleware/methodoverride/methodoverride.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/middleware/methodoverride/methodoverride.go b/middleware/methodoverride/methodoverride.go index 3c1d667e8..6a8914179 100644 --- a/middleware/methodoverride/methodoverride.go +++ b/middleware/methodoverride/methodoverride.go @@ -34,7 +34,7 @@ func (o *options) canOverride(method string) bool { func (o *options) get(w http.ResponseWriter, r *http.Request) string { for _, getter := range o.getters { if v := getter(w, r); v != "" { - return v + return strings.ToUpper(v) } } @@ -198,7 +198,7 @@ func New(opt ...Option) router.WrapperFunc { return func(w http.ResponseWriter, r *http.Request, proceed http.HandlerFunc) { originalMethod := strings.ToUpper(r.Method) if opts.canOverride(originalMethod) { - newMethod := strings.ToUpper(opts.get(w, r)) + newMethod := opts.get(w, r) if newMethod != "" { if opts.saveOriginalMethodContextKey != nil { r = r.WithContext(stdContext.WithValue(r.Context(), opts.saveOriginalMethodContextKey, originalMethod))