Remote APNG attachment treated as application/octet-stream #657
Labels
No labels
approved, awaiting change
bug
configuration
documentation
duplicate
enhancement
extremely low priority
feature request
Fix it yourself
help wanted
invalid
mastodon_api
needs docs
needs tests
not a bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AkkomaGang/akkoma#657
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Server setup
From source (but not my server)
Extra details
Version
Backend: 3.10.3-204-g033b7b04-develop
Frontend: 8afbe5e
What were you trying to do?
The following post from Misskey has a single APNG attachement: https://misskey.io/notes/9l326lrrqd
The misskey API specifies
"type": "image/apng"
and the HTTP server providing the image treats it ascontent-type: image/png
.However in Pleroma API it turns into
"mime_type": "application/octet-stream"
which results in akkoma-fe just showing the generic placeholder file icon instead of the actual image.Since the mimetype is already mangled in the API, I suspect this is a akkoma backend issue and not just akkoma-fe.
What did you expect to happen?
mime_type
should beimage/apng
orimage/png
in API (and then afaict from a glance at its source akkoma-fe will treat and display it as an image)Logs
(Sorry, seems like syntax highlighting and details don't work well together)
The Activity Pub object fetchable from the remote:
Misskey API info about the post:
Full JSON dump
Headers from the source HTTP server for https://media.misskeyusercontent.com/io/2859c26e-cd43-4550-848b-b6243bc3fe28.apng
Akkoma API representation of the remote post:
Full JSON dump
Severity
I can manage
Have you searched for this issue?
APNG attachment treated as application/octet-streamto Remote APNG attachment treated as application/octet-streamI believe, I identified the issue: in both the object attachment validator and the transmogrifier Akkoma uses checks to the effect of
MIME.extensions(attach["mediaType"]) != []
and if that fails strips it or replaces it withapplication/octet-stream
. Presumably this is done to ensure it’s a valid MIME type.Since mime does currently not know about
image/apng
(but it is properly assigned by IANA), we’ll end up with an octet-stream.Sent a fix to upstream, once it’s merged (and the next release tagged), we can upgrade the dep in Akkoma and the problem should be resolved.
.. but here’s the funny bit: eventhough Akkoma directly uses
MIME.
in several places, it is not declared as a dependency. (It still ends up being pulled in as a transitive dep though.) So this will need to be fixed then too.The last release without APNG is
2.0.5
Update: the addition is already merged; that was quick ^^
fixed in
31f90bbb52