Java Spring Security Cors error
I'm trying to enable cors between browser and server api because website shows cors error. I try to add further bean:
But then I get an error:
How to solve this? Should I remove
config.addAllowedOrigin("*");
line? Or should I ask exact url to my UI: "http://localhost:3000/"
What if this url will be changed in production?4 Replies
⌛
This post has been reserved for your question.
Hey @Tomasm21! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
ig you should list all allowed domains with
addAllowedOrigin
if the domain changes, change it there as wellcurrently this :
config.addAllowedOriginPattern("*");
helped
instead of config.addAllowedOrigin("*");
but with asterisk any request from any origin can be acceptedPost Closed
This post has been closed by <@312509109863710732>.