From b2cacd6b0188f983d1b99f968dfa465a98c9f925 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 20 Jan 2024 12:45:43 +0100 Subject: [bugfix] Prevent URL + URI for same account being used as alias target (#2545) * [bugfix] Ensure URL and URI for same account can't both be provided as alias * test whoopsie from previous PR --- internal/processing/account/alias_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'internal/processing/account/alias_test.go') diff --git a/internal/processing/account/alias_test.go b/internal/processing/account/alias_test.go index 9be5721aa..80fdb81c1 100644 --- a/internal/processing/account/alias_test.go +++ b/internal/processing/account/alias_test.go @@ -132,6 +132,17 @@ func (suite *AliasTestSuite) TestAliasAccount() { "http://localhost:8080/users/admin", }, }, + // Alias zork to turtle using both URI and URL + // for turtle. Only URI should end up being used. + { + newAliases: []string{ + "http://localhost:8080/users/1happyturtle", + "http://localhost:8080/@1happyturtle", + }, + expectedAliases: []string{ + "http://localhost:8080/users/1happyturtle", + }, + }, } { var ( ctx = context.Background() -- cgit v1.2.3