httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <jos...@slive.ca>
Subject Re: [users@httpd] AddOutputFilterByType
Date Mon, 02 Jun 2008 16:28:02 GMT
On Mon, Jun 2, 2008 at 11:50 AM, Ben Davies <ben@stickyeyes.com> wrote:
> Sorry, I should have been more explicit:
>
> How would you implement AddOutputFilterByType for filters created with
> ExtFilterDefine?
>
> Example:
>
> I have a flac file. I have a custom filter that converts flac files to mp3
> files. If the request contains the header Accept: audio/mp3, how can I
> ensure that my custom filter will run?
>
> I had a look at the directives for mod_filter and the closest match appears
> to be FilterProvider, but the second argument requires that I specify a
> regular filter.

mod_ext_filter does create "regular" filters that should be usable in
a FilterProvider directive. (Although I have never tried it myself.)

Alternatively, mod_ext_filter has its own set of triggers. For
example, the AddOutputFilterByType directive can be easily replaced by
specifying an intype= argument for your ExtFilterDefine directive. If
you really want to match off the Accept request header (rather than
imitating AddOutputFilterByType as you initially requested), you can
do something like

SetEnvIf Accept audio/mp3 accept-mp3
ExtFilterDefine ... enableenv=accept-mp3

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message