if accountDomain isn't set, use Host value instead (#380)

This commit is contained in:
tobi 2022-02-06 14:07:38 +01:00 committed by GitHub
parent 1b36e85840
commit 85b4f96263
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -44,6 +44,9 @@ func (p *processor) GetWebfingerAccount(ctx context.Context, requestedUsername s
}
accountDomain := viper.GetString(config.Keys.AccountDomain)
if accountDomain == "" {
accountDomain = viper.GetString(config.Keys.Host)
}
// return the webfinger representation
return &apimodel.WellKnownResponse{

View File

@ -623,6 +623,9 @@ func (c *converter) MentionToAS(ctx context.Context, m *gtsmodel.Mention) (vocab
var domain string
if m.TargetAccount.Domain == "" {
accountDomain := viper.GetString(config.Keys.AccountDomain)
if accountDomain == "" {
accountDomain = viper.GetString(config.Keys.Host)
}
domain = accountDomain
} else {
domain = m.TargetAccount.Domain