Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rodarima opened this issue Nov 19, 2024 · 2 comments
Open

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

rodarima opened this issue Nov 19, 2024 · 2 comments
Labels
bug Something isn't working network

Comments

@rodarima
Copy link
Member

rodarima commented Nov 19, 2024

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 rodarima added bug Something isn't working network labels Nov 19, 2024
@rodarima
Copy link
Member Author

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:

dillo/src/cache.c

Lines 1240 to 1242 in f3103cc

/* For non root URLs, ignore redirections and 404 answers */
if (entry->Flags & CA_Redirect || entry->Flags & CA_NotFound)
Client->Callback = Cache_null_client;

Also:

dillo/src/cache.c

Lines 1102 to 1107 in f3103cc

/**
* Don't process data any further, but let the cache fill the entry.
* (Currently used to handle WEB_RootUrl redirects,
* and to ignore image redirects --Jcid)
*/
static void Cache_null_client(int Op, CacheClient_t *Client)

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

@kaimac1
Copy link

kaimac1 commented Dec 3, 2024

I was just looking at the old site and saw that this behaviour is described as intentional:

If Dillo requests an image and receives a response containing a redirection (i.e., pointing to a different URL), the redirection is not followed. These have a strong tendency to be advertisements.

https://dillo-browser.github.io/old/FAQ.html#q28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working network
Projects
None yet
Development

No branches or pull requests

2 participants