File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -637,12 +637,18 @@ def send_head(self):
637
637
# gzipped file, instead of having the browser decompress it immediately,
638
638
# then it can't use the suffix .gz when using emrun.
639
639
# To work around, one can use the suffix .gzip instead.
640
- if 'Accept-Encoding' in self . headers and 'gzip' in self . headers [ 'Accept-Encoding' ] and path .lower ().endswith ('gz' ):
640
+ if path .lower ().endswith ('gz' ):
641
641
self .send_header ('Content-Encoding' , 'gzip' )
642
642
logv ('Serving ' + path + ' as gzip-compressed.' )
643
643
guess_file_type = guess_file_type [:- 2 ]
644
644
if guess_file_type .endswith ('.' ):
645
645
guess_file_type = guess_file_type [:- 1 ]
646
+ elif path .lower ().endswith ('br' ):
647
+ self .send_header ('Content-Encoding' , 'br' )
648
+ logv ('Serving ' + path + ' as brotli-compressed.' )
649
+ guess_file_type = guess_file_type [:- 2 ]
650
+ if guess_file_type .endswith ('.' ):
651
+ guess_file_type = guess_file_type [:- 1 ]
646
652
647
653
ctype = self .guess_type (guess_file_type )
648
654
if guess_file_type .lower ().endswith ('.wasm' ):
You can’t perform that action at this time.
0 commit comments