private void CheckAuth(Socket socket, HttpAuth.AuthorizeOrError auth, HttpSocketContext ctx)
{
if (auth.SendAuthenticate)
{
ctx.AddHeader("WWW-Authenticate", MissingBasicAuth);
ctx.ReturnError(socket, (int)auth.ResponseCode, auth.Error, true);
}
else
{
ctx.ReturnError(socket, (int)auth.ResponseCode, auth.Error, true);
}
}