-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement OPTIONS http method #51
Comments
Just a remark on this (and also to the related PR at #104), it seems that Tide currently stores routes as a HashMap keyed on HTTP method, with values being the routers that contain endpoints with the given HTTP method (and accessed through the URL path). This is just my idea, but one naive way of adding automatic support for That or we somehow keep some other data store inline with the router that keys in the opposite direction, i.e. paths (sans extracted path strings like |
Another similar problem involving the same design choice of routing aforementioned: From the perspective of the semantics of HTTP methods, For example, https://github.com/rustasync/tide/blob/279e0f05a0a24fba9fc192f1d7956ad60fa0cf24/examples/messages.rs#L69 This behaviour is adhered by most matured Web framework in other programming languages. But it seems that many of the famous Web frameworks in Rust prefer to take the contrary way. There would be some performance penalty to be compliant, but I think it is worth discussing. Update: The 404/405 problem has been fixed in https://github.com/http-rs/tide/pull/388/files. |
Any progress on this? It's on the 0.1 milestone, but we're already at 0.6... I'm willing to help out if you point me in the right direction. |
Note from triage: We handle CORS through the We're unsure however if simplify specifying the middleware also setups the options endpoint; it's been a while. We should make it so that we can enable that. One way to get there is by enabling middleware to run before the router, which is something we may want to do for other reasons as well. |
This is a pretty common http method when using javascript's
fetch
api with CORS enabled. I think Tide should probably be able to automatically be able to handle this based on what routes are set and what corresponding methods are available.The text was updated successfully, but these errors were encountered: