httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Astrid Ke├čler <k...@kess-net.de>
Subject Re: Apache q for covalent.net site.
Date Tue, 04 Feb 2003 19:59:43 GMT
On Tue, 4 Feb 2003 10:20:33 -0800, William A. Rowe, Jr. wrote:

> An answer to a user question (and a gripe from me since I've hit this
> problem myself on apache.org);
> 
>> [the links] point to .tar.gz files, which exist.  When they are clicked on,
>> however, they are being renamed to .tar.tar files. Any ideas?
> 
> Renamed by the browser, not the server.
>
> Check in mime.types that we have content types for .tar *and* .gz.  The
> default defines only .tar, so we return application/x-tar.  If it included .gz,
> the *final* pathname element determines the mime type, which would
> be application/x-gzip.

Only sometimes. Think about index.html.gz. In this case the content-type 
should be text/html and content-encoding should be x-gzip. 

And this is, what our default configuration does. There is no content-type 
defined for the extension .gz but a content-encoding. 

> Anyways, because the content type is application/x-tar, and the browser
> sees the *final* extension is .gz, it is choosing to replace .gz with .tar or
> even adding another .tar (e.g., .tar.gz.tar which I've seen also.)

Uhm, no, the browser behaves so because of content-encoding: x-gzip. The 
browser decopmresses the file directly and then wants to act depending on 
the content-type. And some browsers think, they have to store the file with 
an appended extension .tar. But this filename is only a suggestion by the 
browser. The user could (and should) use another one.

> Seems like the ASF needs to choose between removing application/x-tar
> or adding application/x-gzip in the default mime types.  Sure, we have a
> general policy against adding x- extentions, but by adding one, we open
> ourselves up to problems. :-)

Imho a simple
  <Files ~ "\.tar\.gz$">
    AddType application/x-gzip gz
  </Files>
will solve this problem.

 Kess

Mime
View raw message