[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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user