2
0

Add basic support for remote attachments with multiple media types (#34996)

This commit is contained in:
Claire
2025-06-10 15:26:29 +02:00
committed by GitHub
parent c727701839
commit 7a7e0ba4cd
3 changed files with 64 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ class ActivityPub::Parser::MediaAttachmentParser
end
def remote_url
url = Addressable::URI.parse(@json['url'])&.normalize&.to_s
url = Addressable::URI.parse(url_to_href(@json['url']))&.normalize&.to_s
url unless unsupported_uri_scheme?(url)
rescue Addressable::URI::InvalidURIError
nil
@@ -43,7 +43,7 @@ class ActivityPub::Parser::MediaAttachmentParser
end
def file_content_type
@json['mediaType']
@json['mediaType'] || url_to_media_type(@json['url'])
end
private