Method Not Allowed error message may display incorrect route path #53355
Unanswered
IM-Jehong-Ahn
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Current Behavior
Currently,
AbstractRouteCollection::checkForAlternateVerbs()
checks for matching routes across all HTTP methods except the requested one. During this process, routes with wildcard patterns like{any}
can also be matched.Issue
For example:
When a user sends a PUT request to
/users/123
, the current implementation finds the{any}
route and suggests "The PUT method is not supported for route /users/123. Supported methods: POST." - which could be misleading because the POST method actually points to a different catch-all route, not the specific/users/{id}
endpoint.Proposed Solution
checkForAlternateVerbs()
to only return routes that exactly match the current pathBeta Was this translation helpful? Give feedback.
All reactions