Adding "br" on Accept-Encoding modifies the minified polyfill
See original GitHub issueSorry for the lack of details on this issue, I didn’t have time to narrow down the cause, but I think the example are clarifying.
Request with Accept-Encoding: gzip, br
curl --location --request GET 'https://cdn.polyfill.io/v3/polyfill.min.js?features=Object.values,Object.entries,Object.assign,Array.from,Array.prototype.findIndex,Array.prototype.fill,Array.prototype.find,Array.prototype.includes,String.prototype.startsWith,String.prototype.endsWith,String.prototype.includes,Symbol,fetch,Promise,Map,WeakMap,Number.isInteger,Number.isNaN,Set,Function.name,URL,IntersectionObserver,Intl.~locale.en-GB&flags=gated' \
--header 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Mobile/15E148 Safari/604.1' \
--header 'Accept-Encoding: gzip, br'
Results: the Intl
polyfill is not included.
Request with Accept-Encoding: gzip
curl --location --request GET 'https://cdn.polyfill.io/v3/polyfill.min.js?features=Object.values,Object.entries,Object.assign,Array.from,Array.prototype.findIndex,Array.prototype.fill,Array.prototype.find,Array.prototype.includes,String.prototype.startsWith,String.prototype.endsWith,String.prototype.includes,Symbol,fetch,Promise,Map,WeakMap,Number.isInteger,Number.isNaN,Set,Function.name,URL,IntersectionObserver,Intl.~locale.en-GB&flags=gated' \
--header 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Mobile/15E148 Safari/604.1' \
--header 'Accept-Encoding: gzip'
Results: the Intl
polyfill is included:
Other points
- If I ask only for
Intl
on the parameters, both cases come with the requested Polyfill, so that’s why I couldn’t narrow down what also impacts this. - If I ask for the asset not minified, on both cases the
Intl
comes, so I was wondering there might be something related with caching.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Bug: 3.38+ does not detect iOS Safari features properly #2421
Bug report What Until including 3.37 the fetch polyfill is not delivered, ... Adding "br" on Accept-Encoding modifies the minified polyfill #2428.
Read more >Minify and compress network payloads with brotli - web.dev
In this codelab, learn how Brotli compression can further reduce compression ratios and your app's overall size.
Read more >Response compression in ASP.NET Core | Microsoft Learn
The response compression middleware allows adding additional compression ... Change Accept-Encoding: from gzip, deflate, br to none .
Read more >Accept-Encoding - HTTP - MDN Web Docs
The Accept-Encoding request HTTP header indicates the content encoding (usually a compression algorithm) that the client can understand.
Read more >compression npm
If you're following along at home, and aren't seeing Accept-Encoding: "br", make sure you're connecting over HTTPS. It is written in JavaScript, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lucis thanks for the issue. This was a caching issue and has been fixed now, I’ve tried all the curl requests in this issue’s comments and they are all returning the expected polyfills now 👍
that returns Intl ☝️
that returns ResizeObserver
The ie11 reqeuests return the same polyfills regardless of the compression used:
Let’s close this since nothing else is needed to be done 👍