Closed GopherJ closed 5 years ago
You could use existing CORS middleware code as reference https://github.com/actix/actix-web/blob/master/src/middleware/cors.rs
@DoumanAsh hello, I would like the Access-Control-Allow-Origin
always be the value of Origin
field in request header, but I didn't find a way to do this using actix-web's cors middleware.
Could you please check if I did a mistake in my code or give me some information on how to do this using Actix-web's cors middleware. Thanks!
Hello, I am new to rust and actix-web, I'd like to define a custom Cors middleware but found the OPTIONS preflight request doesn't have the headers which should be added when pasing this middleware.
Here is the middleware's code:
Here is the config file:
Here is the
OPTIONS
request