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

Merge branch 'main' into gorm-v2+gormigrate-v2

parents 38edab96 e3a8eb67
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,8 @@ type CorsConfig struct {
}
func (c *CorsConfig) ExpandEnv() {
if _, exists := os.LookupEnv("CORS_ALLOW_CREDENTIALS"); exists {
allowCredentials := strings.ToLower(os.Getenv("CORS_ALLOW_CREDENTIALS"))
if allowCredentials == "1" || allowCredentials == "true" || allowCredentials == "on" || allowCredentials == "yes" {
c.AllowCredentials = true
}
......@@ -50,7 +51,8 @@ func (c *CorsConfig) ExpandEnv() {
c.AllowedOrigins = strings.Split(allowedOrigins, ",")
}
if _, exists := os.LookupEnv("CORS_DEBUG"); exists {
debug := strings.ToLower(os.Getenv("CORS_DEBUG"))
if debug == "1" || debug == "true" || debug == "on" || debug == "yes" {
c.Debug = true
}
}
......
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