production and staging(development)

This commit is contained in:
2026-04-27 16:31:05 +03:00
parent c74d285e55
commit 2a48c1557a
2 changed files with 24 additions and 19 deletions
@@ -160,6 +160,20 @@ public class WebSecurityConfig implements WebMvcConfigurer {// extends WebSecuri
registry.addResourceHandler("/" + dirName + "/**").addResourceLocations("file:/"+ uploadPath + "/");
}
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
// Разрешаем основной домен, стейджинг и вложенные проекты пользователей
.allowedOriginPatterns(
"https://jambotron.com",
"https://*.jambotron.com", // user1.jambotron.com
"https://*.*.jambotron.com", // project1.user1.jambotron.com
"https://*.staging.jambotron.com" // dev-feature.staging.jambotron.com
)
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
.allowedHeaders("*")
.allowCredentials(true); // Нужно для работы с сессиями и куками
}
}