Skip to content

Commit cba9f8a

Browse files
committed
minor tweaks
1 parent cc36ec0 commit cba9f8a

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/AspNetCore.SecurityKey/SecurityKeyEndpointFilter.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using AspNetCore.Extensions.Authentication;
2-
31
using Microsoft.AspNetCore.Http;
42
using Microsoft.Extensions.Logging;
53

src/AspNetCore.SecurityKey/SecurityKeyExtractor.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ public SecurityKeyExtractor(IOptions<SecurityKeyOptions> securityKeyOptions)
2929
if (context is null)
3030
return null;
3131

32-
if (context.Request.Headers.TryGetValue(_securityKeyOptions.HeaderName, out var headerKey))
32+
var request = context.Request;
33+
if (request.Headers.TryGetValue(_securityKeyOptions.HeaderName, out var headerKey))
3334
return headerKey;
3435

35-
if (context.Request.Query.TryGetValue(_securityKeyOptions.QueryName, out var queryKey))
36+
if (request.Query.TryGetValue(_securityKeyOptions.QueryName, out var queryKey))
3637
return queryKey;
3738

38-
if (context.Request.Cookies.TryGetValue(_securityKeyOptions.CookieName, out var cookieKey))
39+
if (request.Cookies.TryGetValue(_securityKeyOptions.CookieName, out var cookieKey))
3940
return cookieKey;
4041

4142
return null;

src/AspNetCore.SecurityKey/SecurityKeyValidator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public SecurityKeyValidator(
4444
/// <inheritdoc />
4545
public async ValueTask<ClaimsIdentity> Authenticate(string? value, CancellationToken cancellationToken = default)
4646
{
47-
var isValid = await Validate(value);
47+
var isValid = await Validate(value, cancellationToken);
4848

4949
if (!isValid)
5050
return new ClaimsIdentity();

0 commit comments

Comments
 (0)