Skip to content

Fix CORS on redirects#243

Open
rob-maron wants to merge 5 commits into
mainfrom
test-cors
Open

Fix CORS on redirects#243
rob-maron wants to merge 5 commits into
mainfrom
test-cors

Conversation

@rob-maron
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/app.rs
server.with(
CorsMiddleware::new()
.allow_methods("GET, POST".parse::<HeaderValue>().unwrap())
.allow_methods("GET, POST, OPTIONS".parse::<HeaderValue>().unwrap())
Copy link
Copy Markdown
Member

@Ayiga Ayiga Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe OPTIONS needs to be included within Access-Control-Allow-Methods. After all, a pre-flight request is done using the OPTIONS verb, so you wouldn't have any way of knowing without making the initial request.

Funnily enough, GET, HEAD, and POST are always allowed anyway, but they should still be included so we do have some value here.

Here's a post that reinforces that this OPTIONS value is not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants