mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 22:17:22 +01:00
fix empty header
This commit is contained in:
parent
74209b3952
commit
bb866b72f7
1 changed files with 5 additions and 2 deletions
|
|
@ -32,10 +32,13 @@ namespace MareSynchronosShared.Authentication
|
||||||
|
|
||||||
protected override async Task<AuthenticateResult> HandleAuthenticateAsync()
|
protected override async Task<AuthenticateResult> HandleAuthenticateAsync()
|
||||||
{
|
{
|
||||||
Request.Headers.TryGetValue("Authorization", out var authHeader);
|
if(!Request.Headers.TryGetValue("Authorization", out var authHeader))
|
||||||
|
{
|
||||||
|
authHeader = string.Empty;
|
||||||
|
}
|
||||||
var ip = _accessor.GetIpAddress();
|
var ip = _accessor.GetIpAddress();
|
||||||
|
|
||||||
var authResult = await _authClient.AuthorizeAsync(new AuthRequest() {Ip = ip, SecretKey = authHeader});
|
var authResult = await _authClient.AuthorizeAsync(new AuthRequest() {Ip = ip, SecretKey = authHeader}).ConfigureAwait(false);
|
||||||
|
|
||||||
if (!authResult.Success)
|
if (!authResult.Success)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue