[bugfix] Fix error message for account-domain/host validation being the wrong way around (#4851)

Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4850

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4851
This commit is contained in:
tobi
2026-06-08 15:45:00 +02:00
committed by tobi
parent 06c10bba83
commit 4ce10bdb5e
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ func Validate() error {
SetAccountDomain(GetHost())
} else if !dns.IsSubDomain(ad, host) {
errf("%s %s is not a valid subdomain of %s %s",
AccountDomainFlag, ad, HostFlag, host)
HostFlag, host, AccountDomainFlag, ad)
}
}
+3 -3
View File
@@ -77,10 +77,10 @@ func (suite *ConfigValidateTestSuite) TestValidateAccountDomainNotSubdomain1() {
testrig.InitTestConfig()
config.SetHost("gts.example.org")
config.SetAccountDomain("example.com")
config.SetAccountDomain("somethingelse.com")
err := config.Validate()
suite.EqualError(err, "account-domain example.com is not a valid subdomain of host gts.example.org")
suite.EqualError(err, "host gts.example.org is not a valid subdomain of account-domain somethingelse.com")
}
func (suite *ConfigValidateTestSuite) TestValidateAccountDomainNotSubdomain2() {
@@ -90,7 +90,7 @@ func (suite *ConfigValidateTestSuite) TestValidateAccountDomainNotSubdomain2() {
config.SetAccountDomain("gts.example.org")
err := config.Validate()
suite.EqualError(err, "account-domain gts.example.org is not a valid subdomain of host example.org")
suite.EqualError(err, "host example.org is not a valid subdomain of account-domain gts.example.org")
}
func (suite *ConfigValidateTestSuite) TestValidateConfigNoProtocol() {