File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/router/request_matcher Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -89,9 +89,11 @@ impl<T: RouteData> RequestMatcher<T> for MethodMatcher<T> {
8989 fn trace ( & self , request : & Request ) -> Vec < Trace < T > > {
9090 let mut traces = self . any_method . trace ( request) ;
9191 let request_method = request. method ( ) ;
92+ let mut found = false ;
9293
9394 for ( methods, matcher) in & self . exclude_methods {
9495 if !methods. contains ( & request_method. into ( ) ) {
96+ found = true ;
9597 let method_traces = matcher. trace ( request) ;
9698
9799 traces. push ( Trace :: new (
@@ -120,6 +122,7 @@ impl<T: RouteData> RequestMatcher<T> for MethodMatcher<T> {
120122
121123 for ( method, matcher) in & self . methods {
122124 if method == request_method {
125+ found = true ;
123126 let method_traces = matcher. trace ( request) ;
124127
125128 traces. push ( Trace :: new (
@@ -146,7 +149,7 @@ impl<T: RouteData> RequestMatcher<T> for MethodMatcher<T> {
146149 }
147150 }
148151
149- if !self . methods . contains_key ( request_method ) {
152+ if !found {
150153 traces. push ( Trace :: new (
151154 true ,
152155 false ,
You can’t perform that action at this time.
0 commit comments