You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
synctv/server/middlewares/cors.go

15 lines
289 B
Go

package middlewares
import (
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
)
func NewCors() gin.HandlerFunc {
config := cors.DefaultConfig()
config.AllowAllOrigins = true
config.AllowHeaders = []string{"*"}
config.AllowMethods = []string{"*"}
return cors.New(config)
}