How does cors work with poem-openapi? #155
Answered
by
sunli829
liang-kang
asked this question in
Q&A
-
I just try to add cors in openapi/hello-world, just as below:
And then test by curl:
There is no |
Beta Was this translation helpful? Give feedback.
Answered by
sunli829
Jan 6, 2022
Replies: 2 comments 4 replies
-
The Server::new(TcpListener::bind("127.0.0.1:3000"))
.run(Route::new().nest("/api", api_service).nest("/", ui).with(Cors::new()))
.await |
Beta Was this translation helpful? Give feedback.
3 replies
-
If the request does not have the
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
liang-kang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the request does not have the
Origin
header, means it is not a cross-domain request and there will be noaccess-control-allow-origin
header in the response.