Skip to content

Commit 3e53dd5

Browse files
committed
lol really?
1 parent cdac59f commit 3e53dd5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

MyMusicBoxApi/main.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"musicboxapi/http"
99
"musicboxapi/logging"
1010
"os"
11+
"time"
1112

1213
"github.com/gin-contrib/cors"
1314
"github.com/gin-gonic/gin"
@@ -68,8 +69,12 @@ func corsMiddelWare() gin.HandlerFunc {
6869
return cors.Default()
6970
} else {
7071
strictCors := cors.New(cors.Config{
71-
AllowAllOrigins: false,
72-
AllowOrigins: []string{origin}, // move to env
72+
AllowAllOrigins: false,
73+
AllowOrigins: []string{origin}, // move to env
74+
AllowMethods: []string{"GET", "POST", "PUT", "PATCH", "DELETE"},
75+
AllowHeaders: []string{"Origin", "Content-Length", "Content-Type"},
76+
AllowCredentials: false,
77+
MaxAge: 12 * time.Hour,
7378
})
7479
return strictCors
7580
}

0 commit comments

Comments
 (0)