mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix] Fix potential dereference of accounts on own instance (#757)
* add GetAccountByUsernameDomain * simplify search * add escape to not deref accounts on own domain * check if local + we have account by ap uri
This commit is contained in:
4
internal/cache/account_test.go
vendored
4
internal/cache/account_test.go
vendored
@@ -69,6 +69,10 @@ func (suite *AccountCacheTestSuite) TestAccountCache() {
|
||||
if account.URL != "" && !ok && !accountIs(account, check) {
|
||||
suite.Fail("Failed to fetch expected account with URL: %s", account.URL)
|
||||
}
|
||||
check, ok = suite.cache.GetByUsernameDomain(account.Username, account.Domain)
|
||||
if !ok && !accountIs(account, check) {
|
||||
suite.Fail("Failed to fetch expected account with username/domain: %s/%s", account.Username, account.Domain)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user