Skip to content

Commit

Permalink
fix: Cors error when PUT request (#1806)
Browse files Browse the repository at this point in the history
  • Loading branch information
JanCizmar committed Jul 17, 2023
1 parent 0610146 commit de2c231
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit de2c231

Please sign in to comment.