httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Kaluža <>
Subject Re: mod_mime_magic, gzipped tarballs and Docker
Date Tue, 19 Jan 2016 10:57:12 GMT
On 01/18/2016 09:22 PM, William A Rowe Jr wrote:
> On Mon, Jan 18, 2016 at 5:13 AM, Jan Kaluža <
> <>> wrote:
>     On 01/08/2016 07:44 PM, William A Rowe Jr wrote:
>         Do we have to repeat the softmagic call if checkzmagic resolves to
>         x-gzip/x-deflate and the internal content type needs to be
>         deciphered?
>     That's true.
>     I think that Yann's patch moving the zmagic call after the softmagic
>     call would just mean that zmagic won't be called at all if the
>     softmagic recognizes the file format.
>     We would have to check the softmagic result by something similar to
>     "magic_rsl_to_request" and if it's type we want to decompress, we
>     would have to run zmagic.
>     Before really trying to do so, I want to ask if I understand the
>     reasoning right. Do we consider this way because users can then
>     remove x-gzip from mime magic and will be able to use it to disable
>     the mod_mime_magic behaviour discussed in this thread?
> Yes... and in a more flexible manner that allows us to override any
> compression mode, not only deflate, by simply tweaking the magic entries.
> Putting magic file entry overrides into the mod_mime_magic directives is
> a lot more interesting than simply toggling compression recognition.

Okay... I have something half-way right now.

Attached patch changes the order of softmagic and zmagic. When softmagic 
recognizes a file, the zmagic is called. zmagic method checks if the 
file has been recognized as "x-gzip" and it tries to uncompress it and 
call "tryit" again with the uncompressed data as before.

I'm now playing with an idea to extend the magic file so we wouldn't 
have to keep the "x-gzip" -> "gzip -dcq" relation hardcoded, but it 
could be defined in the magic file instead.

William, is the patch close to the behaviour you were describing?

Jan Kaluza

View raw message