It all depends on what the user wants to have when they are done downloading. 
In the case of HTML, CSS, and JS, they want an uncompressed file that is ready 
for their browser to use. So you should use Content-Encoding: gzip and 
Content-Type: text/html or whatever. In the case of a .tar.gz, they may be 
expecting to find a tar.gz file in their downloads folder, so you should use 
Content-Type: application/gzip (not just gzip).

But rather than trying to guess what the user wants, you can go by the filename 
in the request. If the request specifies a filename ending in .gz, use 
Content-Type: application/gzip; if your server is adding the .gz, use 
Content-Encoding: gzip. (And check the Accept-Encoding header too.)

Andy

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to