Accept header contains image/webp even if WebP support is disabled
Categories
(Core :: Graphics: ImageLib, defect)
Tracking
()
People
(Reporter: jan.reges, Unassigned)
References
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36
Steps to reproduce:
Firefox has unpleasant inconsistency with respecting of disabled WebP support.
There are few available methods, how to implement WebP image support to websites and Firefox doesn't work properly with one of them. Some methods based on Accept header to HTML, some are based on Accept header to image (for example CDN), some are based on custom HTML <picture> with <source srcset="x" type="image/webp">.
Lot of our websites have WebP support based on detecting WebP support by "Accept" request header to HTML page.
-
Disable WebP support in "about:config" and set "image.webp.enabled: FALSE". Lot of our visitors (and my colleagues) never changed this setting, but they probably have WebP support disabled because they installed Firefox version few years ago. Today they have latest version due to automatic updates, but some configuration defaults are old, included with "image.webp.enabled: FALSE".
-
Make request to any website and check requests headers for HTML page and also check request headers for some image URL.
Actual results:
-
Request for HTML page contains "image/webp" in "Accept" header and this is big problem. Server side recognize, that browser supports "image/webp", so it generate to HTML image URL addresses for WebP images. But rendering phase see, that WebP is disabled, so images are not displayed.
-
Requests for images URLs are OK - "Accept" header doesn't contain "image/webp". But when WebP is enabled in Firefox, "image/webp" is presented and it is proper and expected behavior.
Expected results:
-
Request for HTML page should not contains "image/webp", when WebP support is disabled. Then server-side which generating HTML and detecting WebP support from "Accept" header will be working properly.
-
Requests for images URLs shouldn't contains "image/webp" in "Accept" header (this works properly).
Comment 1•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 2•4 years ago
|
||
Which Firefox are you using? I think bug 1658008 should fix this.
Comment 3•4 years ago
|
||
Confirmed in 85.0a1 (2020-11-30)
With image.webp.enabled true:
Accept
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
With image.webp.enabled false:
Accept
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,*/*;q=0.8
Updated•4 years ago
|
Comment 4•4 years ago
|
||
Note that I had intended to remove the pref in bug 1641389, which I hadn't landed because of some test failures...
Description
•