Extensionless Document images render as files in pleroma-fe #7951

Open
opened 2026-07-30 03:31:31 +00:00 by lambadalambda · 0 comments

Bug

PR #7933 moved MIME sniffing from ActivityPub attachment ingestion to MediaProxy response streaming. This fixes the response headers, but Mastodon API attachment metadata is rendered before MediaProxy is requested.

An extensionless ActivityStreams Document with mediaType: application/octet-stream is therefore returned as attachment type: unknown. pleroma-fe maps that to its file placeholder and never selects the image renderer. The Image fallback added by #7933 does not cover Document attachments.

Reproduction

Rendering this attachment at current develop returns type: unknown:

{
  "type": "Document",
  "url": [{
    "mediaType": "application/octet-stream",
    "href": "https://example.com/extensionless"
  }]
}

Expected

When bounded inspection identifies image bytes, persist the detected image MIME during ingestion so Mastodon API clients receive type: image. Keep MediaProxy response sniffing for correct serving headers. Inspection failures and non-images should retain the generic type without rejecting ingestion.

## Bug PR #7933 moved MIME sniffing from ActivityPub attachment ingestion to MediaProxy response streaming. This fixes the response headers, but Mastodon API attachment metadata is rendered before MediaProxy is requested. An extensionless ActivityStreams `Document` with `mediaType: application/octet-stream` is therefore returned as attachment `type: unknown`. pleroma-fe maps that to its file placeholder and never selects the image renderer. The `Image` fallback added by #7933 does not cover `Document` attachments. ## Reproduction Rendering this attachment at current `develop` returns `type: unknown`: ```json { "type": "Document", "url": [{ "mediaType": "application/octet-stream", "href": "https://example.com/extensionless" }] } ``` ## Expected When bounded inspection identifies image bytes, persist the detected image MIME during ingestion so Mastodon API clients receive `type: image`. Keep MediaProxy response sniffing for correct serving headers. Inspection failures and non-images should retain the generic type without rejecting ingestion.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pleroma/pleroma#7951
No description provided.