Skip to content
Snippets Groups Projects
Verified Commit bd5d3679 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

feat: read CORS_ALLOWED_HEADERS & CORS_ALLOWED_METHODS from the env

parent f0f3481d
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,14 @@ func (c *CorsConfig) ExpandEnv() {
c.AllowCredentials = true
}
if allowedHeaders, exists := os.LookupEnv("CORS_ALLOWED_HEADERS"); exists {
c.AllowedHeaders = strings.Split(allowedHeaders, ",")
}
if allowedMethods, exists := os.LookupEnv("CORS_ALLOWED_METHODS"); exists {
c.AllowedMethods = strings.Split(allowedMethods, ",")
}
if allowedOrigins, exists := os.LookupEnv("CORS_ALLOWED_ORIGINS"); exists {
c.AllowedOrigins = strings.Split(allowedOrigins, ",")
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment