OPTIONS request handling for cors #62
Replies: 3 comments 8 replies
-
Beside pub fn method(&mut self, method: http_types::Method, ep: impl Endpoint<State>) -> &mut Self; |
Beta Was this translation helpful? Give feedback.
-
Currently this is not supported, but is on the list of high-priority functionality. I'm not sure what the implementation will look like, but I've opened #63 to track this issue. |
Beta Was this translation helpful? Give feedback.
-
@happysalada, @prabirshrestha Options handling has been added in [email protected] — there is both a default OPTIONS response that uses the route table to send the correct allowed methods for a given request path, and the ability to add a route for an arbitrary http method, including OPTIONS, which overrides the default behavior. It is also possible to disable the default OPTIONS handling |
Beta Was this translation helpful? Give feedback.
-
On a cors request the browser sends an OPTIONS request to check for the cors header.
How can I respond to the OPTIONS request. I couldn't find a method on the router for it.
https://docs.rs/trillium-router/0.1.0/trillium_router/struct.Router.html
I tried using any but it didn't work. Perhaps there is a way I haven't found yet?
Or is it just waiting adding an
Options
here ? https://docs.rs/trillium-router/0.1.0/src/trillium_router/router.rs.html#138Just curious.
Beta Was this translation helpful? Give feedback.
All reactions