diff --git a/websocket-sharp/Net/HttpConnection.cs b/websocket-sharp/Net/HttpConnection.cs index 6011ef68..89b5fff0 100644 --- a/websocket-sharp/Net/HttpConnection.cs +++ b/websocket-sharp/Net/HttpConnection.cs @@ -302,6 +302,9 @@ namespace WebSocketSharp.Net conn._lastListener = lsnr; } + if (!conn._context.Authenticate ()) + return; + if (conn._context.Register ()) conn._contextRegistered = true; diff --git a/websocket-sharp/Net/HttpListener.cs b/websocket-sharp/Net/HttpListener.cs index ed6358c2..c8334987 100644 --- a/websocket-sharp/Net/HttpListener.cs +++ b/websocket-sharp/Net/HttpListener.cs @@ -582,9 +582,6 @@ namespace WebSocketSharp.Net if (!_listening) return false; - if (!context.Authenticate ()) - return false; - lock (_ctxRegistrySync) { if (!_listening) return false;