You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The router currently returns 404 Not Found even if the path (and thus the resource) exists but the request method does not match. In such a situation, to be a good HTTP citizen, it should return 405 Method Not Allowed and indicate the available methods for the desired resource in the "Allow" header.
I've looked into your router implementation. The way the routes are currently organized, doing this wouldn't be that easy (and fast) because you have a separate tree for each request method. I think you should have one tree instead and store the defined methods along with their handlers in the node structure.
To customize the server response, in addition to the NotFound handler to be found in the Router structure, there should also be a MethodNotAllowed handler. It should be passed a list of allowed methods.
Regards,
Claudio
The text was updated successfully, but these errors were encountered:
Hi Julien
The router currently returns 404 Not Found even if the path (and thus the resource) exists but the request method does not match. In such a situation, to be a good HTTP citizen, it should return 405 Method Not Allowed and indicate the available methods for the desired resource in the "Allow" header.
I've looked into your router implementation. The way the routes are currently organized, doing this wouldn't be that easy (and fast) because you have a separate tree for each request method. I think you should have one tree instead and store the defined methods along with their handlers in the node structure.
To customize the server response, in addition to the NotFound handler to be found in the Router structure, there should also be a MethodNotAllowed handler. It should be passed a list of allowed methods.
Regards,
Claudio
The text was updated successfully, but these errors were encountered: