Merge branch 'main' into main

This commit is contained in:
6543 2023-03-21 01:33:33 +00:00
commit 4e60a72236
4 changed files with 16 additions and 3 deletions

View file

@ -64,7 +64,7 @@ func (x xDB) Put(domain string, cert *certificate.Resource) error {
}
defer sess.Close()
if exist, _ := sess.ID(c.Domain).Exist(); exist {
if exist, _ := sess.ID(c.Domain).Exist(new(Cert)); exist {
if _, err := sess.ID(c.Domain).Update(c); err != nil {
return err
}

View file

@ -37,7 +37,7 @@ func TestSanitizeWildcardCerts(t *testing.T) {
}))
// update existing cert
assert.Error(t, certDB.Put(".wildcard.de", &certificate.Resource{
assert.NoError(t, certDB.Put(".wildcard.de", &certificate.Resource{
Domain: "*.wildcard.de",
Certificate: localhost_mock_directory_certificate,
}))