- 
                Notifications
    You must be signed in to change notification settings 
- Fork 38.8k
Description
I want to use to use PostMapping with path pattern all ("/") and header condition "Connection!=Upgrade". But when i send a websocket request which always contains header "Connection=Upgrade", it match the "/" method and give message "Method GET not supportted". I debug the program and find the "/**" method is selected and throw execption when method not matched in org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping#handleNoMatch.
The DispatchSelvet iterate HandlerMapping to get request handler. RequestMappingInfoHandlerMapping fallback to handleNoMatch() when no method found. It use PartialMatchHelper to get matched path pattern matched conditions. Then throw exception if method/ consume/ params not matched. It also does not match headers.
- As RequestMappingInfoHandlerMapping is the first attempt in DispatchSevlet, other HandlerMapping will ignored when it throws exception.
- When path pattern matches but any other condition not matches, it should return nothing matched and try match other handlers.