mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 21:02:26 -05:00
[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
This commit is contained in:
parent
60d7060895
commit
9d80f7fd68
3 changed files with 57 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue