Closed Bug 1680764 Opened 4 years ago Closed 4 years ago

Accept header contains image/webp even if WebP support is disabled

Categories

(Core :: Graphics: ImageLib, defect)

Firefox 83
defect

Tracking

()

RESOLVED FIXED

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.

  1. 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".

  2. Make request to any website and check requests headers for HTML page and also check request headers for some image URL.

Actual results:

  1. 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.

  2. 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:

  1. 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.

  2. Requests for images URLs shouldn't contains "image/webp" in "Accept" header (this works properly).

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → ImageLib
Product: Firefox → Core

Which Firefox are you using? I think bug 1658008 should fix this.

Flags: needinfo?(jan.reges)
See Also: → 1658008

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
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Flags: needinfo?(jan.reges)

Note that I had intended to remove the pref in bug 1641389, which I hadn't landed because of some test failures...

You need to log in before you can comment on or make changes to this bug.