New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CORS Example #34
Comments
.with( Cors::new() .allow_origin("localhost") .allow_method(Method::POST)) |
Are you using the |
No, 0.6.10. I'll try to upgrade. |
Same result with 0.7.1. This is my code:
This is the response headers: |
If I use:
It works! But I've tried "localhost", "localhost:3000" and "http://localhost:3000" and none of those work. |
Alright, it's some weird Firefox only behaviour! If I set allow_origin to "http://localhost:3000" and open the test page in Chrome it works?! Either way, nothing to do with Poem. Sorry to waste your time. |
Haha, thank you for helping me test. 😁 |
I'm very sorry, I found a bug, I will fix it and release a new version. @shnads |
Fixed in |
@sunli829 Thanks you're awesome! I ported across a fairly large project from Actix to Poem in an afternoon and it was completely painless. Love your work. |
Hey, sorry to bother, it seems I am running into a cors issue again.
Just for reference, adding the Thank you for the amazing framework! (just in case, I verified that I was on the latest version 1.0.28, let me know if anything of course) |
The let cors =
Cors::new()
.allow_methods([Method::POST, Method::GET, Method::OPTIONS]); |
I worked like a charm ❤️ Thanks a lot! |
Hello,
I'm really enjoying using Poem, but I've got to the point with my project that I need CORS and I can't figure out how it works? Is there an example somewhere for using the CORS middleware?
I'm doing it like this:
.with( Cors::new() .allow_origin("http://localhost:3000") .allow_method(Method::POST), );
But only the last call seems to take effect?
The text was updated successfully, but these errors were encountered: