Modified HTTP auth for HttpListener class
This commit is contained in:
parent
5003c10e0c
commit
04966f221b
@ -114,7 +114,7 @@ namespace WebSocketSharp.Net
|
|||||||
string realm,
|
string realm,
|
||||||
Func<IIdentity, NetworkCredential> credentialsFinder)
|
Func<IIdentity, NetworkCredential> credentialsFinder)
|
||||||
{
|
{
|
||||||
if (scheme == AuthenticationSchemes.None) {
|
if (!(scheme == AuthenticationSchemes.Basic || scheme == AuthenticationSchemes.Digest)) {
|
||||||
context.Response.Close (HttpStatusCode.Forbidden);
|
context.Response.Close (HttpStatusCode.Forbidden);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -131,11 +131,10 @@ namespace WebSocketSharp.Net
|
|||||||
if (scheme == AuthenticationSchemes.Basic)
|
if (scheme == AuthenticationSchemes.Basic)
|
||||||
context.Response.CloseWithAuthChallenge (
|
context.Response.CloseWithAuthChallenge (
|
||||||
AuthenticationChallenge.CreateBasicChallenge (realm).ToBasicString ());
|
AuthenticationChallenge.CreateBasicChallenge (realm).ToBasicString ());
|
||||||
else if (scheme == AuthenticationSchemes.Digest)
|
|
||||||
|
if (scheme == AuthenticationSchemes.Digest)
|
||||||
context.Response.CloseWithAuthChallenge (
|
context.Response.CloseWithAuthChallenge (
|
||||||
AuthenticationChallenge.CreateDigestChallenge (realm).ToDigestString ());
|
AuthenticationChallenge.CreateDigestChallenge (realm).ToDigestString ());
|
||||||
else
|
|
||||||
context.Response.Close (HttpStatusCode.Forbidden);
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user