diff options
author | 2022-08-20 22:47:19 +0200 | |
---|---|---|
committer | 2022-08-20 21:47:19 +0100 | |
commit | 570fa7c3598118ded6df7ced0a5326f54e7a43e2 (patch) | |
tree | 9575a6f3016c73b7109c88f68a2a512981cf19e4 /internal/cache/account_test.go | |
parent | [docs] Textual updates on markdown files (#756) (diff) | |
download | gotosocial-570fa7c3598118ded6df7ced0a5326f54e7a43e2.tar.xz |
[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
Diffstat (limited to 'internal/cache/account_test.go')
-rw-r--r-- | internal/cache/account_test.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/cache/account_test.go b/internal/cache/account_test.go index ff882cc3d..a6d3c6b7d 100644 --- a/internal/cache/account_test.go +++ b/internal/cache/account_test.go @@ -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) + } } } |