Replies: 1 comment 1 reply
-
Sorry about that. It's by design that Dropshot doesn't support middleware for the reasons explained here: This does make some things more annoying and I don't have a better suggestion for you on this one. The wrapper you've got there seems pretty reasonable. It sounds annoying to have to implement all the |
Beta Was this translation helpful? Give feedback.
-
Hey,
I'm using Dropshot to build and expose an OpenAPI endpoint that is consumed by some JS frontend. I also have to deal with CORS, as I will not serve the frontend through the dropshot server.
Is there an idiomatic way of dealing with CORS (e.g. setting headers, answering to preflight OPTION requests) with Dropshot ? My workaround for now is encapsulating my HttpResponse in a CorsResponse struct, e.g.
I'm also implementing OPTIONS endpoints "manually", but that's not exactly optimal.
Could dropshot support a middleware, e.g. like axum does it ?
Beta Was this translation helpful? Give feedback.
All reactions