fix requests from other origins
We don't care about origins and *want* any code running on any origin to be able
to connect to any peer.
fixes ipfs/go-ipfs#4202
@@ -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)
