revised CORS config for lalowed origins

This commit is contained in:
2026-05-14 14:57:25 +02:00
parent 463fbd8332
commit ef09a3c84d
3 changed files with 6 additions and 15 deletions
@@ -8,16 +8,13 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class CorsConfig implements WebMvcConfigurer {
@Value("${vaessl.frontend-local-url}")
private String frontendLocalUrl;
@Value("${vaessl.frontend-public-url}")
private String frontendPublicUrl;
@Value("${vaessl.allowed-origins}")
private String[] allowedOrigins;
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins(frontendLocalUrl, frontendPublicUrl)
.allowedOrigins(allowedOrigins)
.allowedMethods("GET", "POST", "DELETE", "OPTIONS")
.allowedHeaders("Content-Type", "Accept")
.allowCredentials(true);