[bugfix] Don't call strings.ToLower() on usernames when selecting account by domain+username (#1190)

* don't lowercase account username when doing a select

* test getting remote user with uppercase username
This commit is contained in:
tobi 2022-11-30 17:44:02 +01:00 committed by GitHub
commit 3a11861ac6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 47 additions and 32 deletions

View file

@ -97,6 +97,23 @@ func (suite *SearchGetTestSuite) TestSearchRemoteAccountByNamestring() {
suite.NotNil(gotAccount)
}
func (suite *SearchGetTestSuite) TestSearchRemoteAccountByNamestringUppercase() {
query := "@Some_User@example.org"
resolve := true
searchResult, err := suite.testSearch(query, resolve, http.StatusOK)
if err != nil {
suite.FailNow(err.Error())
}
if !suite.Len(searchResult.Accounts, 1) {
suite.FailNow("expected 1 account in search results but got 0")
}
gotAccount := searchResult.Accounts[0]
suite.NotNil(gotAccount)
}
func (suite *SearchGetTestSuite) TestSearchRemoteAccountByNamestringNoLeadingAt() {
query := "brand_new_person@unknown-instance.com"
resolve := true