Minor Changes
-
BREAKING CHANGE: Requests that match one or more route patterns, but no route registered for the request method, now receive a
405 Method Not Allowedresponse with anAllowheader listing the methods registered for that URL. Previously these requests fell through to the router'sdefaultHandlerand produced a404 Not Foundby default. Matching still falls through to less specific routes that can handle the method (includingANYroutes) before the 405 applies, so catch-all routes keep handling these requests. Register anANYroute if you want a handler to receive every method at a given URL (see #11767). -
Routes registered for
GETnow serveHEADrequests automatically. TheGEThandler runs as usual and the router strips the body from its response, soHEADrequests observe the same status and headers as the equivalentGETrequest. Previously aHEADrequest only matched routes explicitly registered forHEADorANY. An explicitHEADroute for the same pattern still takes precedence over theGETroute (see #11767).