From 9d80f7fd68c5a1c243f1d90a05d8fec028f1c9e8 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:33:01 +0100 Subject: [feature] Allow "charset=utf8" in incoming AP POST requests (#2564) * [feature] Allow "charset=utf8" in incoming AP POST requests * changed my mind * document POSTing to a GtS inbox * correct link --- internal/federation/federatingactor_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'internal/federation/federatingactor_test.go') diff --git a/internal/federation/federatingactor_test.go b/internal/federation/federatingactor_test.go index 348d501d6..d07b56537 100644 --- a/internal/federation/federatingactor_test.go +++ b/internal/federation/federatingactor_test.go @@ -164,6 +164,22 @@ func TestIsASMediaType(t *testing.T) { 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, @@ -196,6 +212,10 @@ func TestIsASMediaType(t *testing.T) { 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) -- cgit v1.2.3