mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-23 08:34:13 -05:00
Allow JSON-LD documents with multiple profiles
This commit is contained in:
parent
3e9dfe1c70
commit
97dc31981f
@ -183,7 +183,11 @@ module JsonLdHelper
|
||||
|
||||
# When the mime type is `application/ld+json`, we need to check the profile,
|
||||
# but `http.rb` does not parse it for us.
|
||||
response.mime_type == 'application/ld+json' && response.headers[HTTP::Headers::CONTENT_TYPE]&.split(';')&.map(&:strip)&.include?('profile="https://www.w3.org/ns/activitystreams"')
|
||||
return false unless response.mime_type == 'application/ld+json'
|
||||
|
||||
response.headers[HTTP::Headers::CONTENT_TYPE]&.split(';')&.map(&:strip)&.any? do |str|
|
||||
str.start_with?('profile="') && str[9...-1].split.include?('https://www.w3.org/ns/activitystreams')
|
||||
end
|
||||
end
|
||||
|
||||
def body_to_json(body, compare_id: nil)
|
||||
|
Loading…
Reference in New Issue
Block a user