1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Added access control header *

This commit is contained in:
Zack Scholl 2016-12-12 19:55:36 -08:00
parent bacee6570d
commit 8c406982f3

View File

@ -15,6 +15,7 @@ var wsupgrader = websocket.Upgrader{
} }
func wshandler(w http.ResponseWriter, r *http.Request) { func wshandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
conn, err := wsupgrader.Upgrade(w, r, nil) conn, err := wsupgrader.Upgrade(w, r, nil)
if err != nil { if err != nil {
fmt.Println("Failed to set websocket upgrade: %+v", err) fmt.Println("Failed to set websocket upgrade: %+v", err)