mirror of
https://github.com/bitwarden/server
synced 2026-01-02 08:33:48 +00:00
fix(auth-validator): [PM-22975] Client Version Validator - Not having the header present now blocks users from validating
This commit is contained in:
@@ -108,7 +108,7 @@ public class ClientVersionValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Allows_When_ClientVersionHeaderMissing()
|
||||
public void Blocks_When_ClientVersionHeaderMissing()
|
||||
{
|
||||
// Arrange
|
||||
var sut = new ClientVersionValidator(MakeContext(null));
|
||||
@@ -119,6 +119,9 @@ public class ClientVersionValidatorTests
|
||||
var ok = sut.ValidateAsync(user, ctx);
|
||||
|
||||
// Assert
|
||||
Assert.True(ok);
|
||||
Assert.False(ok);
|
||||
Assert.NotNull(ctx.ValidationErrorResult);
|
||||
Assert.True(ctx.ValidationErrorResult.IsError);
|
||||
Assert.Equal("version_header_missing", ctx.ValidationErrorResult.Error);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user