Use our own websocket.Server instance.
The websocket.Server used the by websocket.Handler type automatically adds a handshake function which prevents connections when the Origin header is not set. Not all clients send this information and we already require authentication headers as the auth mechanism anyways.
This commit is contained in:
parent
737e69594b
commit
0fbd962f8a
1 changed files with 4 additions and 1 deletions
|
@ -152,7 +152,10 @@ func (s *rpcServer) Start() {
|
||||||
http.Error(w, "401 Unauthorized.", http.StatusUnauthorized)
|
http.Error(w, "401 Unauthorized.", http.StatusUnauthorized)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
websocket.Handler(s.walletReqsNotifications).ServeHTTP(w, r)
|
wsServer := websocket.Server{
|
||||||
|
Handler: websocket.Handler(s.walletReqsNotifications),
|
||||||
|
}
|
||||||
|
wsServer.ServeHTTP(w, r)
|
||||||
})
|
})
|
||||||
|
|
||||||
for _, listener := range s.listeners {
|
for _, listener := range s.listeners {
|
||||||
|
|
Loading…
Reference in a new issue