-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: configure CORS - allow all origins
- Loading branch information
1 parent
b14c91e
commit a7230f6
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
lapis2/src/main/kotlin/org/genspectrum/lapis/CorsConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.genspectrum.lapis | ||
|
||
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 : WebMvcConfigurer { | ||
override fun addCorsMappings(registry: CorsRegistry) { | ||
registry.addMapping("/**") | ||
.allowedOrigins("*") | ||
.allowedMethods("GET", "POST", "OPTIONS") | ||
.allowedHeaders("*") | ||
.maxAge(3600) | ||
} | ||
} |