fusenapi/utils/auth/cors.go

20 lines
701 B
Go
Raw Normal View History

2023-07-11 11:43:46 +00:00
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")
}
2023-08-22 05:43:13 +00:00
func FsCorsResponse(w http.ResponseWriter) {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
w.Header().Set("Access-Control-Allow-Headers", "*")
w.Header().Set("Access-Control-Expose-Headers", "*")
w.Header().Set("Access-Control-Allow-Credentials", "true")
}