mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-07 04:22:04 +00:00
[api] Use 405 method not allowed (#4148)
I was doing a diff and noticed this returns the wrong status code. This PR changes the unknown method response to [405 Method Not Allowed](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405) status code.
This commit is contained in:
@@ -17,9 +17,9 @@ export function withApiHandler(handler: Handler): Handler {
|
||||
}
|
||||
|
||||
if (req.method !== 'GET') {
|
||||
return res.status(404).json({
|
||||
return res.status(405).json({
|
||||
error: {
|
||||
code: 'not_found',
|
||||
code: 'method_not_allowed',
|
||||
message: 'Only GET requests are supported for this endpoint.',
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user