Refactored AuthenticationChallenge.cs and AuthenticationResponse.cs

This commit is contained in:
sta
2014-06-27 21:12:55 +09:00
parent df4b23807e
commit ce39129b87
9 changed files with 302 additions and 252 deletions

View File

@@ -522,10 +522,10 @@ namespace WebSocketSharp.Server
AuthenticationSchemes scheme, TcpListenerWebSocketContext context)
{
var challenge = scheme == AuthenticationSchemes.Basic
? HttpUtility.CreateBasicAuthChallenge (Realm)
: scheme == AuthenticationSchemes.Digest
? HttpUtility.CreateDigestAuthChallenge (Realm)
: null;
? AuthenticationChallenge.CreateBasicChallenge (Realm).ToBasicString ()
: scheme == AuthenticationSchemes.Digest
? AuthenticationChallenge.CreateDigestChallenge (Realm).ToDigestString ()
: null;
if (challenge == null) {
context.Close (HttpStatusCode.Forbidden);