From 04966f221b5b4d028c01bca551096f52154bd53f Mon Sep 17 00:00:00 2001 From: sta Date: Mon, 24 Nov 2014 14:54:30 +0900 Subject: [PATCH] Modified HTTP auth for HttpListener class --- websocket-sharp/Net/HttpListenerAsyncResult.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/websocket-sharp/Net/HttpListenerAsyncResult.cs b/websocket-sharp/Net/HttpListenerAsyncResult.cs index 909f15bf..b562c4c6 100644 --- a/websocket-sharp/Net/HttpListenerAsyncResult.cs +++ b/websocket-sharp/Net/HttpListenerAsyncResult.cs @@ -114,7 +114,7 @@ namespace WebSocketSharp.Net string realm, Func credentialsFinder) { - if (scheme == AuthenticationSchemes.None) { + if (!(scheme == AuthenticationSchemes.Basic || scheme == AuthenticationSchemes.Digest)) { context.Response.Close (HttpStatusCode.Forbidden); return false; } @@ -131,11 +131,10 @@ namespace WebSocketSharp.Net if (scheme == AuthenticationSchemes.Basic) context.Response.CloseWithAuthChallenge ( AuthenticationChallenge.CreateBasicChallenge (realm).ToBasicString ()); - else if (scheme == AuthenticationSchemes.Digest) + + if (scheme == AuthenticationSchemes.Digest) context.Response.CloseWithAuthChallenge ( AuthenticationChallenge.CreateDigestChallenge (realm).ToDigestString ()); - else - context.Response.Close (HttpStatusCode.Forbidden); return false; }