coffeebank / coffee-maubot

Matrix bot plugins for Maubot 🍢 Add link previews, choose, and other tools to your Matrix chat ☕
https://coffeebank.github.io/coffee-maubot
11 stars 5 forks source link

urlpreview: htmlparser sometimes identifies images as wrong mime-type #37

Open ajkessel opened 3 months ago

ajkessel commented 3 months ago

When generating previews for some links, the synapse previewer correctly identifies images as mimetype svg but the htmlparser previewer identifies the same images as mimetype png and thus they do not render correctly. An example would be any Overcast URL, e.g., https://overcast.fm/+E24DJXFmY . Both previewers retrieve https://overcast.fm/img/logo.svg as the associated preview image, but it comes back from synapse (correctly) as an svg and comes back from htmlparser (incorrectly) as a png.