dillo-browser / dillo

Dillo, a multi-platform graphical web browser
https://dillo-browser.github.io/
GNU General Public License v3.0
577 stars 30 forks source link

Images not loading for http://retro.hackaday.com #304

Open rodarima opened 3 days ago

rodarima commented 3 days ago

Loading the website causes the images not to display. But following a link and then going back causes the images to properly load.

Reported-by: Flea86

rodarima commented 3 days ago

Reproducer:

<img src="http://hackaday.com/wp-content/uploads/2011/11/pic.jpg">

The image returns a 301 redirect:

GET /wp-content/uploads/2011/11/pic.jpg HTTP/1.1
Host: hackaday.com
User-Agent: Dillo/3.1.1
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Referer: http://hackaday.com/
Connection: keep-alive

HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Tue, 19 Nov 2024 19:42:16 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
Location: https://hackaday.com/wp-content/uploads/2011/11/pic.jpg
cache-control: max-age=31536000
x-rq: mad1 

<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

Dillo seems to ignore redirects on non-root requests like images:

https://github.com/dillo-browser/dillo/blob/f3103cc4b6c369da96c7de487214a9e56eca755d/src/cache.c#L1240-L1242

Also:

https://github.com/dillo-browser/dillo/blob/f3103cc4b6c369da96c7de487214a9e56eca755d/src/cache.c#L1102-L1107

This predates the git history (2007), so I don't know the context at which this was done. It looks simply unfinished.