diff --git a/backend/app/src/main/kotlin/io/tolgee/configuration/CorsConfiguration.kt b/backend/app/src/main/kotlin/io/tolgee/configuration/CorsConfiguration.kt deleted file mode 100644 index ddc999930d..0000000000 --- a/backend/app/src/main/kotlin/io/tolgee/configuration/CorsConfiguration.kt +++ /dev/null @@ -1,20 +0,0 @@ -package io.tolgee.configuration - -import io.tolgee.component.VersionFilter -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.WebMvcConfigurer - -@Configuration -class CorsConfiguration { - @Bean - fun corsMappingConfigurer(): WebMvcConfigurer { - return object : WebMvcConfigurer { - override fun addCorsMappings(registry: CorsRegistry) { - registry.addMapping("/**") - .exposedHeaders(VersionFilter.TOLGEE_VERSION_HEADER_NAME) - } - } - } -} diff --git a/backend/app/src/main/kotlin/io/tolgee/configuration/WebConfiguration.kt b/backend/app/src/main/kotlin/io/tolgee/configuration/WebConfiguration.kt index 06e7ff63be..7b7539491c 100644 --- a/backend/app/src/main/kotlin/io/tolgee/configuration/WebConfiguration.kt +++ b/backend/app/src/main/kotlin/io/tolgee/configuration/WebConfiguration.kt @@ -5,6 +5,7 @@ package io.tolgee.configuration import com.fasterxml.jackson.databind.ObjectMapper +import io.tolgee.component.VersionFilter import io.tolgee.configuration.tolgee.TolgeeProperties import org.apache.http.impl.client.HttpClientBuilder import org.springframework.boot.web.servlet.MultipartConfigFactory @@ -49,7 +50,9 @@ class WebConfiguration( } override fun addCorsMappings(registry: CorsRegistry) { - registry.addMapping("/**").allowedMethods("GET", "POST", "PUT", "DELETE") + registry.addMapping("/**") + .allowedMethods("HEAD", "GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS") + .exposedHeaders(VersionFilter.TOLGEE_VERSION_HEADER_NAME) } @Bean