新增自定义的 Cors

This commit is contained in:
eson
2023-07-11 19:43:46 +08:00
parent e0de8bfcf2
commit a4f429a528
17 changed files with 88 additions and 21 deletions

11
utils/auth/cors.go Normal file
View File

@@ -0,0 +1,11 @@
package auth
import "net/http"
func FsCors(header http.Header) {
header.Set("Access-Control-Allow-Origin", "*")
header.Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
header.Set("Access-Control-Allow-Headers", "*")
header.Set("Access-Control-Expose-Headers", "*")
header.Set("Access-Control-Allow-Credentials", "true")
}