Partial Path pattern not match headers #34322
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: invalid
An issue that we don't feel is valid
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.
The text was updated successfully, but these errors were encountered: