cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How can I GET a gzipped static resource and have libcurl uncompress it?

From: Guenter <lists_at_gknw.net>
Date: Sat, 13 Jun 2009 04:09:49 +0200

Hi,
Daniel Stenberg schrieb:
> Can't you trick the server into providing one?
the distributors usually tend to split the default Apache2 httpd.conf
into serveral files to make it some harder for the users :)
f.e. with OpenSuSE the setting is in mod_mime-default.conf, and its also
commented:
#AddEncoding x-gzip .gz .tgz

when I enable this I can see for a *.gz file in the headers checked with
'curl -I http://...':
...
Content-Type: application/x-gzip
Content-Encoding: x-gzip

you can also set this in a .htaccess file, and set to whatever you want:
AddType application/ExtractMe .gz .tgz
AddEncoding gzip .gz .tgz

gives back what you requested:
...
Content-Type: application/extractme
Content-Encoding: gzip

more docu here:
http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addencoding
http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addtype

HTH, Gün.
Received on 2009-06-13