新增自定义的 Cors
This commit is contained in:
11
utils/auth/cors.go
Normal file
11
utils/auth/cors.go
Normal 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")
|
||||
}
|
||||
Reference in New Issue
Block a user