mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
minor, relative to: https://github.com/kataras/iris/issues/1325
Former-commit-id: 9febac1ba701b29e59d7660540f03217f12cf9e0
This commit is contained in:
parent
3342ac5439
commit
8ac32ed27c
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue
Block a user