serenity icon indicating copy to clipboard operation
serenity copied to clipboard

LibWeb: Favicon loading does not respect redirection attempts and silently fails

Open Hendiadyoin1 opened this issue 3 years ago • 2 comments

See the title

A page where this is the case is https://thiscatdoesnotexist.com -> 301 Moved Permanently (which also crashes because of an unimplemented JPG Encoding (SOF2))

Hendiadyoin1 avatar Jul 03 '22 19:07 Hendiadyoin1

I'm seeing https://thiscatdoesnotexist.com/favicon.ico return 404 at the moment, not 301. ~~In general it looks like the handling for non-200 status codes could be improved though, so I'll propose a PR for that.~~

Edit: I'm actually not convinced that it's wrong to just do what we currently do: try to decode as image whatever we get from the server, regardless of the status code.

From reading the code, it looks like we would handle redirects just fine (here), but I haven't tried it firsthand.

eggpi avatar Jul 10 '22 16:07 eggpi

The way I found this issue is printing any non 200 response code on favicon requests and we somehow got a 301 on the mentioned site

Hendiadyoin1 avatar Jul 16 '22 13:07 Hendiadyoin1