diff options
author | 2021-07-19 18:42:08 +0200 | |
---|---|---|
committer | 2021-07-19 18:42:08 +0200 | |
commit | b1a4f38e383279d14d10b6b4575f752ca4b54f73 (patch) | |
tree | 813429385388f6ce7f6255d53210ce9ba914e796 /internal/api/s2s/webfinger/webfingerget.go | |
parent | Db tls (#102) (diff) | |
download | gotosocial-b1a4f38e383279d14d10b6b4575f752ca4b54f73.tar.xz |
allow different host + accountDomain (#103)
* allow different host + accountDomain
* use accountDomain in tags
Diffstat (limited to 'internal/api/s2s/webfinger/webfingerget.go')
-rw-r--r-- | internal/api/s2s/webfinger/webfingerget.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/api/s2s/webfinger/webfingerget.go b/internal/api/s2s/webfinger/webfingerget.go index 416a75f3b..1d723e67c 100644 --- a/internal/api/s2s/webfinger/webfingerget.go +++ b/internal/api/s2s/webfinger/webfingerget.go @@ -50,23 +50,23 @@ func (m *Module) WebfingerGETRequest(c *gin.Context) { return } - usernameDomain := strings.Split(withAcct[1], "@") - if len(usernameDomain) != 2 { + usernameAndAccountDomain := strings.Split(withAcct[1], "@") + if len(usernameAndAccountDomain) != 2 { l.Debugf("aborting request because username and domain could not be parsed from %s", withAcct[1]) c.JSON(http.StatusBadRequest, gin.H{"error": "bad request"}) return } - username := strings.ToLower(usernameDomain[0]) - domain := strings.ToLower(usernameDomain[1]) - if username == "" || domain == "" { + username := strings.ToLower(usernameAndAccountDomain[0]) + accountDomain := strings.ToLower(usernameAndAccountDomain[1]) + if username == "" || accountDomain == "" { l.Debug("aborting request because username or domain was empty") c.JSON(http.StatusBadRequest, gin.H{"error": "bad request"}) return } - if domain != m.config.Host { - l.Debugf("aborting request because domain %s does not belong to this instance", domain) - c.JSON(http.StatusBadRequest, gin.H{"error": fmt.Sprintf("domain %s does not belong to this instance", domain)}) + if accountDomain != m.config.AccountDomain { + l.Debugf("aborting request because accountDomain %s does not belong to this instance", accountDomain) + c.JSON(http.StatusBadRequest, gin.H{"error": fmt.Sprintf("accountDomain %s does not belong to this instance", accountDomain)}) return } |