--- Begin Message ---
"Brian Cassidy" <[EMAIL PROTECTED]> writes:
> > > Also, there needs to be something selectable for the users who happen to
> > > have Compress::Zlib but don't want to get compressed data for whatever
> > > reason.
> >
> > It would certainly not happen by default. If you download a .tar.gz
> > file you don't want to end up with a .tar file just because you
> > happened to have Compress::Zlib installed.
>
> Okay, but, wouldn't the tar.gz file be a tar.gz.gz file if it were
> content-encoded (gzip)? Thus uncompressing it would give you back the tar.gz
> file.
No. A server does the right thing if it marks a gziped file tar file
with "Content-Encoding: gzip". Some examples:
[EMAIL PROTECTED] gisle]$ HEAD http://cpan.org/src/latest.tar.gz
200 OK
Connection: close
Date: Tue, 02 Dec 2003 20:00:08 GMT
Accept-Ranges: bytes
ETag: "94cf4-b585df-adad8740"
Server: Apache/2.0.47 (Unix) DAV/2
Content-Encoding: x-gzip
Content-Length: 11896287
Content-Type: application/x-tar
Last-Modified: Wed, 05 Nov 2003 23:36:21 GMT
Client-Date: Tue, 02 Dec 2003 20:00:08 GMT
Client-Peer: 63.251.223.172:80
Client-Response-Num: 1
[EMAIL PROTECTED] gisle]$ HEAD ftp://ftp.cpan.org/pub/CPAN/src/latest.tar.gz
200 OK
Server: (vsFTPd 1.1.3)
Content-Encoding: gzip
Content-Length: 11896287
Content-Type: application/x-tar
Last-Modified: Wed, 05 Nov 2003 23:36:21 GMT
Client-Date: Tue, 02 Dec 2003 20:00:54 GMT
Client-Request-Num: 1
> It was always my understanding that if "content-encoding" has a value, then
> doing the reverse will give you back the original file, regardless of any
> original compression.
In HTTP there is not really any concept of an original file. There is
just an entity (aka content) that is described with various Content-*
headers. A Content-Encoding header just says that there is some
transform needed on the content before you obtain the media type
denoted by the Content-Type header.
Regards,
Gisle
--- End Message ---