Allow origin

This commit is contained in:
Andrea Fazzi 2021-11-03 16:05:47 +01:00
parent 91c42a6867
commit 9f3cf93538

View file

@ -56,7 +56,11 @@ func serveFile(c *gin.Context, filename string) error {
func main() { func main() {
r := gin.Default() r := gin.Default()
r.Use(cors.New(cors.Config{ r.Use(cors.New(cors.Config{
AllowOrigins: []string{"http://localhost:8080", "http://localhost:5000"}, AllowOrigins: []string{
"http://localhost:8080",
"http://localhost:5000",
"https://yt-dls.andreafazzi.eu",
},
AllowCredentials: true, AllowCredentials: true,
AllowHeaders: []string{"*"}, AllowHeaders: []string{"*"},
})) }))