File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/main/java/de/tum/cit/aet/artemis/core/config Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 24
24
import org .springframework .context .annotation .Profile ;
25
25
import org .springframework .core .env .Environment ;
26
26
import org .springframework .http .MediaType ;
27
+ import org .springframework .util .CollectionUtils ;
27
28
import org .springframework .web .cors .CorsConfiguration ;
28
29
import org .springframework .web .cors .UrlBasedCorsConfigurationSource ;
29
30
import org .springframework .web .filter .CorsFilter ;
@@ -117,7 +118,7 @@ private String resolvePathPrefix() {
117
118
public CorsFilter corsFilter () {
118
119
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource ();
119
120
CorsConfiguration config = jHipsterProperties .getCors ();
120
- if (config .getAllowedOrigins () != null && ! config . getAllowedOrigins (). isEmpty ( )) {
121
+ if (! CollectionUtils . isEmpty ( config .getAllowedOrigins ()) || ! CollectionUtils . isEmpty ( config . getAllowedOriginPatterns () )) {
121
122
log .debug ("Registering CORS filter" );
122
123
source .registerCorsConfiguration ("/api/**" , config );
123
124
source .registerCorsConfiguration ("/management/**" , config );
You can’t perform that action at this time.
0 commit comments