mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
12 lines
267 B
Go
12 lines
267 B
Go
package base
|
|
|
|
import "net/http"
|
|
|
|
// EnableCrossOrigin enable cross origin
|
|
func EnableCrossOrigin(w http.ResponseWriter) {
|
|
header := w.Header()
|
|
|
|
header.Set("Access-Control-Allow-Origin", "*")
|
|
header.Set("Access-Control-Allow-Methods", "HEAD, GET, POST, OPTIONS")
|
|
}
|