summaryrefslogtreecommitdiff
path: root/internal/federation/federatingactor_test.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-02-14 11:13:38 +0000
committerLibravatar GitHub <noreply@github.com>2024-02-14 12:13:38 +0100
commit2bafd7daf542d985ee76d9079a30a602cb7be827 (patch)
tree8817fe6f202155d660d75c17cd78ff5dae3d4530 /internal/federation/federatingactor_test.go
parent[feature] Add metrics for instance user count, statuses count and federating ... (diff)
downloadgotosocial-2bafd7daf542d985ee76d9079a30a602cb7be827.tar.xz
[bugfix] add stricter checks during all stages of dereferencing remote AS objects (#2639)
* add stricter checks during all stages of dereferencing remote AS objects * a comment
Diffstat (limited to 'internal/federation/federatingactor_test.go')
-rw-r--r--internal/federation/federatingactor_test.go68
1 files changed, 0 insertions, 68 deletions
diff --git a/internal/federation/federatingactor_test.go b/internal/federation/federatingactor_test.go
index d07b56537..b6814862f 100644
--- a/internal/federation/federatingactor_test.go
+++ b/internal/federation/federatingactor_test.go
@@ -154,71 +154,3 @@ 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/activity+json; charset=utf-8",
- Expect: true,
- },
- {
- Input: "application/activity+json;charset=utf-8",
- Expect: true,
- },
- {
- Input: "application/activity+json ;charset=utf-8",
- Expect: true,
- },
- {
- Input: "application/activity+json ; charset=utf-8",
- 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,
- },
- {
- Input: "application/ld+json",
- Expect: false,
- },
- } {
- if federation.IsASMediaType(test.Input) != test.Expect {
- t.Errorf("did not get expected result %v for input: %s", test.Expect, test.Input)
- }
- }
-}