Only apply CORS headers in development
This commit is contained in:
@@ -44,13 +44,14 @@ func init() {
|
||||
log.Println("Successfully retrieved EULA blocked servers")
|
||||
|
||||
app.Use(recover.New())
|
||||
|
||||
if config.Environment == "development" {
|
||||
app.Use(cors.New(cors.Config{
|
||||
AllowOrigins: "*",
|
||||
AllowMethods: "HEAD,OPTIONS,GET",
|
||||
ExposeHeaders: "Content-Type,X-Cache-Time-Remaining",
|
||||
}))
|
||||
|
||||
if config.Environment == "development" {
|
||||
app.Use(logger.New(logger.Config{
|
||||
Format: "${time} ${ip}:${port} -> ${method} ${path} -> ${status}\n",
|
||||
TimeFormat: "2006/01/02 15:04:05",
|
||||
|
||||
Reference in New Issue
Block a user