Cors behavour? #151
Answered
by
sunli829
ChillFish8
asked this question in
Q&A
Cors behavour?
#151
-
I've been playing around accessing an API created with poem which has to go through CORS. The issue I've ran into is with the following setup of cors: Cors::new()
.allow_origins(["http://127.0.0.1:3000", "http://localhost:3000"])
.allow_header("*")
.allow_methods([Method::GET, Method::POST, Method::DELETE, Method::OPTIONS])
.allow_credentials(true) But when trying to access an endpoint with the required authorization. The preflight check gets rejected with Is this intended? Im not sure if I'm missing some setting on the cors middleware or something with CORS but this feels slightly un-natural. |
Beta Was this translation helpful? Give feedback.
Answered by
sunli829
Dec 31, 2021
Replies: 1 comment 1 reply
-
remove this line:
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ChillFish8
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
remove this line:
.allow_header("*")