[bugfix/chore] Inbox post updates (#1821)

Co-authored-by: kim <grufwub@gmail.com>
This commit is contained in:
tobi 2023-05-28 21:05:15 +02:00 committed by GitHub
commit 46d4ec0f05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 620 additions and 452 deletions

View file

@ -151,3 +151,51 @@ func (suite *FederatingActorTestSuite) TestSendRemoteFollower() {
func TestFederatingActorTestSuite(t *testing.T) {
suite.Run(t, new(FederatingActorTestSuite))
}
func TestIsASMediaType(t *testing.T) {
for _, test := range []struct {
Input string
Expect bool
}{
{
Input: "application/activity+json",
Expect: true,
},
{
Input: "application/ld+json;profile=https://www.w3.org/ns/activitystreams",
Expect: true,
},
{
Input: "application/ld+json;profile=\"https://www.w3.org/ns/activitystreams\"",
Expect: true,
},
{
Input: "application/ld+json ;profile=https://www.w3.org/ns/activitystreams",
Expect: true,
},
{
Input: "application/ld+json ;profile=\"https://www.w3.org/ns/activitystreams\"",
Expect: true,
},
{
Input: "application/ld+json ; profile=https://www.w3.org/ns/activitystreams",
Expect: true,
},
{
Input: "application/ld+json ; profile=\"https://www.w3.org/ns/activitystreams\"",
Expect: true,
},
{
Input: "application/ld+json; profile=https://www.w3.org/ns/activitystreams",
Expect: true,
},
{
Input: "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"",
Expect: true,
},
} {
if federation.IsASMediaType(test.Input) != test.Expect {
t.Errorf("did not get expected result %v for input: %s", test.Expect, test.Input)
}
}
}