When loading a file that ends in .gz, sirv will set the Content-Encoding header to gzip which means browsers will unzip the content before handing it back to fetch or XMLHttpRequest.
This PR adds a workaround to the asset server that sets the header to a garbage value if a file ending in .gz has been requested.
It's necessary to use a garbage value because sirv sets the headers after the setHeaders function passed to it's config has been invoked, and it will only not set the header if one has been set already.
Description
When loading a file that ends in
.gz
,sirv
will set theContent-Encoding
header togzip
which means browsers will unzip the content before handing it back tofetch
orXMLHttpRequest
.This PR adds a workaround to the asset server that sets the header to a garbage value if a file ending in
.gz
has been requested.It's necessary to use a garbage value because
sirv
sets the headers after thesetHeaders
function passed to it's config has been invoked, and it will only not set the header if one has been set already.Link to issue
Type of change
Please delete options that are not relevant.