Closed crowmagnumb closed 3 years ago
As of Spring Framework 5.3, CorsRegistration
exposes an allowedOriginPatterns(String...)
method which delegates to CorsConfiguration.setAllowedOriginPatterns(List<String>)
.
Does that meet your needs?
If not, why do you explicitly need to invoke setAllowedOriginPatterns(List<String>)
instead of allowedOriginPatterns(String...)
?
Ugh. OK, even though I am importing org.springframework.spring-web
version 5.3.0
in one part of my code. I am using primarily org.springframework.boot.spring-boot-starter-web
which is at version 2.3.5.RELEASE
, well actually 2.4.0
was just released 3 hours ago, BUT that is on org.springframework:spring-web:5.2.2.RELEASE
! So, my IDE is picking up that one and thus I don't see the method. Why is the boot code not more up-to-date with the core stuff?
I need to legitimately know how to keep these things all in sync so that I don't have duplicate spring-core/spring-web code multiple times in my classpath. So currently I use org.springframework.spring-web
for my server to make http requests of other servers. I use org.springframework.boot.spring-boot-starter-web
to create an api to connect to my server. And I use org.springframework.session.spring-session-jdbc
to save session information of client connects to the server. I just tried to figure out a scenario of these three dependencies that all share a common spring-web
version and could not. If I use version 2.3.5.RELEASE of spring-boot-starter-web it seems to use 5.2.10.RELEASE of spring-web. But spring-session-jdbc
version 2.3.1
uses 5.2.9.RELEASE and the next version 2.4.0
uses 5.3.0
so there exists no version of that that uses the same version I need for boot. Is there a concerted effort to coordinate release schedules beteween these diffferent aspects of springframework?
Sorry, for the barrage here, but wanted to let you know that I set just cleared my local maven cache of all springframework code, reset my pom variables to...
<springcore.version>5.3.0</springcore.version>
<springboot.version>2.4.0</springboot.version>
<springsession.version>2.4.1</springsession.version>
... and rebuilt everything. And now I only have spring-web version 5.3.0. I have both 5.3.0 and 5.3.1 of core, but my built jar file with all dependencies only contains 5.3.0. And now I see the method I was looking for in my IDE. Thank you for bearing with me.
No problem.
Affects: 5.3.0
I use the following code to configure CORS...
But I would like to use the
setAllowedOriginPatterns
that is onCorsConfiguration
butCorsRegistration
does not expose this so I can't. Why is this protected?