serenity
serenity copied to clipboard
LibWeb: Favicon loading does not respect redirection attempts and silently fails
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))
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.
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