Skip to content

Commit

Permalink
fix ws cors bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
jjeffcaii committed Nov 22, 2019
1 parent 57b391e commit eb40ca7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/transport/transport_ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ func init() {
upgrader = websocket.Upgrader{
ReadBufferSize: 1024,
WriteBufferSize: 1024,
CheckOrigin: func(r *http.Request) bool {
return cors
},
}
if cors {
upgrader.CheckOrigin = func(r *http.Request) bool {
return true
}
}
}

Expand Down

0 comments on commit eb40ca7

Please sign in to comment.