From 3a11861ac67655aa87dea219067277ab30c553ad Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Wed, 30 Nov 2022 17:44:02 +0100 Subject: [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 --- internal/processing/followrequest_test.go | 4 ++-- internal/processing/fromfederator_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/processing') diff --git a/internal/processing/followrequest_test.go b/internal/processing/followrequest_test.go index 5be615ab5..399afb566 100644 --- a/internal/processing/followrequest_test.go +++ b/internal/processing/followrequest_test.go @@ -56,7 +56,7 @@ func (suite *FollowRequestTestSuite) TestFollowRequestAccept() { suite.NoError(errWithCode) suite.EqualValues(&apimodel.Relationship{ID: "01FHMQX3GAABWSM0S2VZEC2SWC", Following: false, ShowingReblogs: false, Notifying: false, FollowedBy: true, Blocking: false, BlockedBy: false, Muting: false, MutingNotifications: false, Requested: false, DomainBlocking: false, Endorsed: false, Note: ""}, relationship) - // accept should be sent to some_user + // accept should be sent to Some_User var sent [][]byte if !testrig.WaitFor(func() bool { sentI, ok := suite.httpClient.SentMessages.Load(requestingAccount.InboxURI) @@ -119,7 +119,7 @@ func (suite *FollowRequestTestSuite) TestFollowRequestReject() { suite.NoError(errWithCode) suite.EqualValues(&apimodel.Relationship{ID: "01FHMQX3GAABWSM0S2VZEC2SWC", Following: false, ShowingReblogs: false, Notifying: false, FollowedBy: false, Blocking: false, BlockedBy: false, Muting: false, MutingNotifications: false, Requested: false, DomainBlocking: false, Endorsed: false, Note: ""}, relationship) - // reject should be sent to some_user + // reject should be sent to Some_User var sent [][]byte if !testrig.WaitFor(func() bool { sentI, ok := suite.httpClient.SentMessages.Load(requestingAccount.InboxURI) diff --git a/internal/processing/fromfederator_test.go b/internal/processing/fromfederator_test.go index 22d0ba9f4..75cef43f5 100644 --- a/internal/processing/fromfederator_test.go +++ b/internal/processing/fromfederator_test.go @@ -556,12 +556,12 @@ func (suite *FromFederatorTestSuite) TestCreateStatusFromIRI() { APActivityType: ap.ActivityCreate, GTSModel: nil, // gtsmodel is nil because this is a forwarded status -- we want to dereference it using the iri ReceivingAccount: receivingAccount, - APIri: testrig.URLMustParse("http://example.org/users/some_user/statuses/afaba698-5740-4e32-a702-af61aa543bc1"), + APIri: testrig.URLMustParse("http://example.org/users/Some_User/statuses/afaba698-5740-4e32-a702-af61aa543bc1"), }) suite.NoError(err) // status should now be in the database, attributed to remote_account_2 - s, err := suite.db.GetStatusByURI(context.Background(), "http://example.org/users/some_user/statuses/afaba698-5740-4e32-a702-af61aa543bc1") + s, err := suite.db.GetStatusByURI(context.Background(), "http://example.org/users/Some_User/statuses/afaba698-5740-4e32-a702-af61aa543bc1") suite.NoError(err) suite.Equal(statusCreator.URI, s.AccountURI) } -- cgit v1.2.3