Added localhost for CORS
This commit is contained in:
parent
ca95125188
commit
bf653f7216
1 changed files with 1 additions and 9 deletions
|
|
@ -40,21 +40,13 @@ func getCORSConfig(env string) cors.Config {
|
||||||
}
|
}
|
||||||
case "prod":
|
case "prod":
|
||||||
return cors.Config{
|
return cors.Config{
|
||||||
AllowOrigins: []string{"https://ocboapps.davaocity.gov.ph", "https://esign.patalcala.com"},
|
AllowOrigins: []string{"https://ocboapps.davaocity.gov.ph", "https://esign.patalcala.com", "http://localhost:8080", "http://127.0.0.1:8080"},
|
||||||
AllowMethods: []string{"GET", "POST", "OPTIONS", "DELETE"},
|
AllowMethods: []string{"GET", "POST", "OPTIONS", "DELETE"},
|
||||||
// AllowHeaders: []string{"Origin", "OCBO-Token", "Content-Length", "Content-Type", "X-Server", "Authorization"},
|
// AllowHeaders: []string{"Origin", "OCBO-Token", "Content-Length", "Content-Type", "X-Server", "Authorization"},
|
||||||
AllowHeaders: []string{"*"},
|
AllowHeaders: []string{"*"},
|
||||||
ExposeHeaders: []string{"Content-Length"},
|
ExposeHeaders: []string{"Content-Length"},
|
||||||
AllowCredentials: true,
|
AllowCredentials: true,
|
||||||
}
|
}
|
||||||
case "lan":
|
|
||||||
return cors.Config{
|
|
||||||
AllowOrigins: []string{"*"},
|
|
||||||
AllowMethods: []string{"GET", "POST", "OPTIONS", "DELETE"},
|
|
||||||
AllowHeaders: []string{"*"},
|
|
||||||
ExposeHeaders: []string{"Content-Length"},
|
|
||||||
AllowCredentials: true,
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
return cors.DefaultConfig()
|
return cors.DefaultConfig()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue