Merge pull request #496 from chr33z/fix/api-auhorization-filter-495

fix: Prevent invalid authorization headers from accessing the API
This commit is contained in:
Jared Goodwin 2022-08-01 17:15:48 -07:00 committed by GitHub
commit 33084e96c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,7 @@ namespace Remotely.Server.Auth
if (headerComponents.Length < 2)
{
context.HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
context.Result = new UnauthorizedResult();
return;
};
@ -49,6 +50,7 @@ namespace Remotely.Server.Auth
if (authComponents.Length < 2)
{
context.HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
context.Result = new UnauthorizedResult();
return;
};