mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 18:37:05 +00:00
minor: see prev commit for a new feature
Former-commit-id: ab76d81d325778052e013b028f1d44d29adea618
This commit is contained in:
@@ -198,7 +198,7 @@ func New(opt ...Option) router.WrapperFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request, proceed http.HandlerFunc) {
|
return func(w http.ResponseWriter, r *http.Request, proceed http.HandlerFunc) {
|
||||||
originalMethod := strings.ToUpper(r.Method)
|
originalMethod := strings.ToUpper(r.Method)
|
||||||
if opts.canOverride(originalMethod) {
|
if opts.canOverride(originalMethod) {
|
||||||
newMethod := opts.get(w, r)
|
newMethod := strings.ToUpper(opts.get(w, r))
|
||||||
if newMethod != "" {
|
if newMethod != "" {
|
||||||
if opts.saveOriginalMethodContextKey != nil {
|
if opts.saveOriginalMethodContextKey != nil {
|
||||||
r = r.WithContext(stdContext.WithValue(r.Context(), opts.saveOriginalMethodContextKey, originalMethod))
|
r = r.WithContext(stdContext.WithValue(r.Context(), opts.saveOriginalMethodContextKey, originalMethod))
|
||||||
|
|||||||
Reference in New Issue
Block a user