From 2e4bbbd8106ef442370f6a7e944429e1c0f52e41 Mon Sep 17 00:00:00 2001 From: aarbit Date: Tue, 30 Sep 2025 00:20:26 -0500 Subject: [PATCH] Removes breaking and unneeded config annotation --- .../net/halfbinary/tmnt/config/WebConfig.kt | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/net/halfbinary/tmnt/config/WebConfig.kt b/src/main/kotlin/net/halfbinary/tmnt/config/WebConfig.kt index 8c6a3cd..3e7ed8d 100644 --- a/src/main/kotlin/net/halfbinary/tmnt/config/WebConfig.kt +++ b/src/main/kotlin/net/halfbinary/tmnt/config/WebConfig.kt @@ -1,14 +1,20 @@ package net.halfbinary.tmnt.config +import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.web.servlet.config.annotation.CorsRegistry -import org.springframework.web.servlet.config.annotation.EnableWebMvc import org.springframework.web.servlet.config.annotation.WebMvcConfigurer -@Configuration -@EnableWebMvc -class WebConfig : WebMvcConfigurer { - override fun addCorsMappings(registry: CorsRegistry) { - registry.addMapping("/**") +@Configuration(proxyBeanMethods = false) +class MyCorsConfiguration { + + @Bean + fun corsConfigurer(): WebMvcConfigurer { + return object : WebMvcConfigurer { + override fun addCorsMappings(registry: CorsRegistry) { + registry.addMapping("/**") + } + } } + } \ No newline at end of file