mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
minor: see prev commit for a new feature
Former-commit-id: ab76d81d325778052e013b028f1d44d29adea618
This commit is contained in:
parent
95ce71be9f
commit
3342ac5439
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user