Added unit test for TryGetBasicAuthCredentials extension method and minor code tidy.

This commit is contained in:
Andy Butland
2021-08-06 12:05:08 +02:00
parent 7859798e8b
commit 9732381933
4 changed files with 50 additions and 8 deletions

View File

@@ -1,3 +1,4 @@
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;
@@ -35,7 +36,7 @@ namespace Umbraco.Cms.Web.Common.Middleware
return;
}
var clientIPAddress = context.Connection.RemoteIpAddress;
IPAddress clientIPAddress = context.Connection.RemoteIpAddress;
if (_basicAuthService.IsIpAllowListed(clientIPAddress))
{
await next(context);