openinbrowser
openinbrowser copied to clipboard
Support for gzip-compressed responses
It would be nice if there was an option to force decompression of gzipped responses.
Example URL and its response: http://ftp.nl.debian.org/debian/dists/jessie/contrib/Contents-amd64.gz
HTTP/1.1 200 OK
Date: Tue, 11 Aug 2015 14:50:59 GMT
Server: Apache/2.2.22 (Debian)
Last-Modified: Sat, 06 Jun 2015 10:42:04 GMT
ETag: "8b20181-15b30-517d70f339700"
Accept-Ranges: bytes
Content-Length: 88880
Content-Type: application/x-gzip
Forcing a Content-Encoding: gzip
response header could help (in addition to setting Content-Type: text/plain
).
This feature was also requested in a Review for Open in Browser by megabyte. Firefox issue that could affect a possible implementation: Bug 52282 - (ftp:// or file://) suffixes like (.gz) are Content-Encoding (not Content-Type) [decode and display .gz file]
Content-Encoding can unfortunately not be overridden using setResponseHeader, see https://github.com/Lekensteyn/openinbrowser/commit/7c55f700cfbbc188ddc17c0c869722fccaa77fcc for an attempt. Other ideas?
Hi Peter,
Yeah that looks like a bummer. No idea comes to mind, unless a totally different approach is used instead of hijacking the response headers.
Would this only apply to the case where a single file is compressed using gzip?
It would also be nice to be able to open a compressed folder, and then select a file inside it to view, all within the browser.