elk-zone / elk

A nimble Mastodon web client
https://elk.zone
MIT License
5.34k stars 553 forks source link

preview image for links not shown correctly for Pleroma/Akkoma instances (with no mediaproxy) #2140

Open kimusan opened 1 year ago

kimusan commented 1 year ago

I noticed that image preview for toots seen from an akkoma/Pleroma instance account are broken image

The same post seen from a Mastodon account shows the image just fine: image

The image seem to be there just fine but for some reason it does not get loaded:

From Akkoma instance (seems like no media proxy is enabled:

<img alt="Pass the eWPTXv2 Exam on Your First Attempt in 2023! - Pass the eWPTXv2 Exam on Your First Attempt in 2023!" w-full="" h-full="" object-cover="" class="" data-src="https://hashnode.com/utility/r?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fstock%2Funsplash%2FzvHhKiVuR9M%2Fupload%2Ff65d2a6592f6b0ddaf803bcdc59c73af.jpeg%3Fw%3D1200%26h%3D630%26fit%3Dcrop%26crop%3Dentropy%26auto%3Dcompress%2Cformat%26format%3Dwebp%26fm%3Dpng" data-sizes="auto" loading="lazy" sizes="96px">
from mastodon (where media proxy is enabled):
<img width="400" height="210" alt="Pass the eWPTXv2 Exam on Your First Attempt in 2023! - Pass the eWPTXv2 Exam on Your First Attempt in 2023!" w-full="" h-full="" object-cover="" class="" data-sizes="auto" loading="lazy" src="https://social.data.coop/system/cache/preview_cards/images/000/456/129/original/0ea1d7aba269a353.jpeg" sizes="516px">

I wonder if it is some CORS/CSP mismatch that causes this?

stackblitz[bot] commented 1 year ago

Solve in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

dragon2611 commented 1 year ago

This also seems to be the case when media proxy is enabled but uses a different domain to the akkoma instance.

kimusan commented 1 year ago

tried enabling media proxy for the akkoma instance but still see the problem - domain is the same

leopku commented 1 year ago

Same Issue as #2172.

Mastodon A.P.I compatible backend PocketRSS with no media proxy.

PS: videos works fine.