lobsters/lobsters

Wrong Content-Type in JPEG images

Open

#2,009 建立於 2026年5月2日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)Ruby (4,680 star) (961 fork)user submission
buggood first issue

描述

Some avatar images are not loading in Dillo:

This is caused because the Content-Type HTTP header for the images are always set to image/png, despite being JPEG:

% curl -sI https://lobste.rs/avatars/ohrv-16.png | grep -i content-type
content-type: image/png
% curl -s https://lobste.rs/avatars/ohrv-16.png | file -
/dev/stdin: JPEG image data, JFIF standard 1.01, resolution (DPI), density 96x96, segment length 16, comment: "CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90", baseline, precision 8, 16x16, components 3

Dillo uses the Content-Type to select which image decoder to use. As it doesn't recognize the JPEG format as a PNG, it complains and ignores the image:

** WARNING **: "https://lobste.rs/avatars/ohrv-16.png" is not a PNG file.

Could you change this behavior to match the Content-Type to the image format?

貢獻者指南

Wrong Content-Type in JPEG images · lobsters/lobsters#2009 | Good First Issue