diff --git a/src/main/java/dev/surl/surl/cfg/security/CrossOriginConfig.kt b/src/main/java/dev/surl/surl/cfg/security/CrossOriginConfig.kt new file mode 100644 index 0000000..2889ab8 --- /dev/null +++ b/src/main/java/dev/surl/surl/cfg/security/CrossOriginConfig.kt @@ -0,0 +1,17 @@ +package dev.surl.surl.cfg.security + +import org.springframework.context.annotation.Configuration +import org.springframework.web.servlet.config.annotation.CorsRegistry +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer + +@Configuration +open class CrossOriginConfig : WebMvcConfigurer { + override fun addCorsMappings(registry: CorsRegistry) { + registry.addMapping("/**").apply { + allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") + allowedHeaders("*") + allowedOrigins("*") + maxAge(3600) + } + } +} \ No newline at end of file