ensure federation info fqdn to lowercase

This commit is contained in:
Michael Jerger 2024-02-07 14:30:17 +01:00
parent e05c810823
commit 5a7f6f15a6
5 changed files with 24 additions and 6 deletions

View file

@ -39,6 +39,17 @@ func Test_FederationHostValidation(t *testing.T) {
LatestActivity: time.Now().Add(1 * time.Hour),
}
if res, _ := validation.IsValid(sut); res {
t.Errorf("sut should be invalid")
t.Errorf("sut should be invalid: Future timestamp")
}
sut = FederationHost{
HostFqdn: "hOst.do.main",
NodeInfo: NodeInfo{
Source: "forgejo",
},
LatestActivity: time.Now(),
}
if res, _ := validation.IsValid(sut); res {
t.Errorf("sut should be invalid: HostFqdn lower case")
}
}