[Modify] Replace it

This commit is contained in:
sta 2016-04-21 15:20:39 +09:00
parent bc48dbf68b
commit 4246526a1c
2 changed files with 4 additions and 5 deletions

View File

@ -582,11 +582,10 @@ namespace WebSocketSharp.Net
_connections.Remove (connection); _connections.Remove (connection);
} }
internal AuthenticationSchemes SelectAuthenticationScheme (HttpListenerContext context) internal AuthenticationSchemes SelectAuthenticationScheme (HttpListenerRequest request)
{ {
return AuthenticationSchemeSelector != null var selector = _authSchemeSelector;
? AuthenticationSchemeSelector (context.Request) return selector != null ? selector (request) : _authSchemes;
: _authSchemes;
} }
internal void UnregisterContext (HttpListenerContext context) internal void UnregisterContext (HttpListenerContext context)

View File

@ -170,7 +170,7 @@ namespace WebSocketSharp.Net
internal bool Authenticate () internal bool Authenticate ()
{ {
var schm = _listener.SelectAuthenticationScheme (this); var schm = _listener.SelectAuthenticationScheme (_request);
if (schm == AuthenticationSchemes.Anonymous) if (schm == AuthenticationSchemes.Anonymous)
return true; return true;