Merge pull request 'attachment: fix over reliance on fileType()' (#3479) from Yonle/pleroma-fe:filetypeservice-1 into develop

Reviewed-on: https://git.pleroma.social/pleroma/pleroma-fe/pulls/3479
This commit is contained in:
HJ 2026-03-04 18:41:30 +00:00
commit 9967f453e7
11 changed files with 42 additions and 64 deletions

View file

@ -1,5 +1,6 @@
import { parseLinkHeader } from '@web3-storage/parse-link-header'
import escapeHtml from 'escape-html'
import fileTypeService from '../file_type/file_type.service.js'
import punycode from 'punycode.js'
import { isStatusNotification } from '../notification_utils/notification_utils.js'
@ -297,6 +298,11 @@ export const parseAttachment = (data) => {
// output.meta = ??? missing
}
if (data.type !== 'unknown') {
output.type = data.type
} else {
output.type = fileTypeService.fileType(output.mimetype)
}
output.url = data.url
output.large_thumb_url = data.preview_url
output.description = data.description