[backend/federation] Allow JSON-LD profile to be specified in a space delimited string
Ref: https://www.w3.org/TR/json-ld11/#example-168-http-request-with-profile-requesting-a-compacted-document-with-a-reference-to-a-compaction-context
This commit is contained in:
parent
2b141f8084
commit
7d55cbe25a
1 changed files with 5 additions and 4 deletions
|
@ -57,10 +57,11 @@ public class ActivityFetcherService(HttpClient client, HttpRequestService httpRq
|
||||||
headersContentType switch
|
headersContentType switch
|
||||||
{
|
{
|
||||||
{ MediaType: "application/activity+json" } => true,
|
{ MediaType: "application/activity+json" } => true,
|
||||||
{ MediaType: "application/ld+json" } when headersContentType.Parameters.Any(p => p is
|
{ MediaType: "application/ld+json" } when headersContentType.Parameters.Any(p =>
|
||||||
{
|
p.Value != null &&
|
||||||
Name: "profile", Value: "https://www.w3.org/ns/activitystreams"
|
p.Name.ToLowerInvariant() == "profile" &&
|
||||||
}) => true,
|
p.Value.Split(" ").Contains("https://www.w3.org/ns/activitystreams"))
|
||||||
|
=> true,
|
||||||
_ => false
|
_ => false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue