changed cors config to use env variables
This commit is contained in:
@@ -8,13 +8,16 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
@Configuration
|
||||
public class CorsConfig implements WebMvcConfigurer {
|
||||
|
||||
@Value("${vaessl.frontend-url}")
|
||||
private String frontendUrl;
|
||||
@Value("${vaessl.frontend-local-url}")
|
||||
private String frontendLocalUrl;
|
||||
|
||||
@Value("${vaessl.frontend-public-url}")
|
||||
private String frontendPublicUrl;
|
||||
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**")
|
||||
.allowedOrigins(frontendUrl, "http://192.168.1.208:5173", "https://5173.code-server.kasuns.website")
|
||||
.allowedOrigins(frontendLocalUrl, frontendPublicUrl)
|
||||
.allowedMethods("GET", "POST", "DELETE", "OPTIONS")
|
||||
.allowedHeaders("Content-Type", "Accept")
|
||||
.allowCredentials(true);
|
||||
|
||||
Reference in New Issue
Block a user