Skip to content

Commit

Permalink
Merge pull request #20 from libp2p/fix/ipfs/go-ipfs/4202
Browse files Browse the repository at this point in the history
fix requests from other origins
  • Loading branch information
Stebalien authored Sep 5, 2017
2 parents a34b3e7 + f455930 commit 16f6845
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion p2p/transport/websocket/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ var WsCodec = &manet.NetCodec{
}

// Default gorilla upgrader
var upgrader = ws.Upgrader{}
var upgrader = ws.Upgrader{
// Allow requests from *all* origins.
CheckOrigin: func(r *http.Request) bool {
return true
},
}

func init() {
err := ma.AddProtocol(WsProtocol)
Expand Down

0 comments on commit 16f6845

Please sign in to comment.