cors_plug
cors_plug copied to clipboard
Origin validation on OPTIONS
Do you think if it's necessary to do check the request's origin against the configuration on OPTIONS request?
Doesn't the line below the one you linked to recall the headers function but with method set to nil so that it goes on to check the requests origin here.
https://github.com/mschae/cors_plug/blob/5dfdbb77be6a0b0eabed376a58ff88f9ee51dace/lib/cors_plug.ex#L54 then https://github.com/mschae/cors_plug/blob/5dfdbb77be6a0b0eabed376a58ff88f9ee51dace/lib/cors_plug.ex#L64
What I mean is in here
https://github.com/mschae/cors_plug/blob/1ca97ed844b200f97bc54df83426815854d1235d/lib/cors_plug.ex#L56-L63
we always set access-control-* headers regardless of the origin is set in configuration or not
Ahh yes I see. Same check as is found here https://github.com/mschae/cors_plug/blob/1ca97ed844b200f97bc54df83426815854d1235d/lib/cors_plug.ex#L74
Could you add a test case that fails because of how it is currently set up. Then we can work out the best way to fix it