You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Leire Cristobo <le...@yahoo.es> on 2004/10/20 10:10:38 UTC

help:filter to change http header

Hello, 
I have to change the mime-type of a file, when it's
requested from a client through my reverse proxy.
Because I think that it's the only way to open this
file (JPG) with a program different from mozilla or
firefox.

I'm trying to change the field Content-Type of http
header using apache 2.0 with mod_proxy,
mod_proxy_http, mod_rewrite and mod_ext_filter.

<IfModule mod_ext_filter.c>
    ExtFilterDefine image-to-appli cmd=: mode=output \
    intype=image/jpeg outtype=application/prueba \
    PreservesContentLength
</IfModule>

<IfModule mod_proxy.c>
   ProxyRequests Off
   ProxyPass        /SIGA http://kolitxa/SIGA
   ProxyPassReverse /SIGA http://kolitxa/SIGA

   <Proxy *>
        SetOutputFilter image-to-appli
        AddType application/prueba .jpg
   </Proxy>
</IfModule>

I don't know if I'm using all the options right, in
the filter I know that it have to have cmd option, so
I use the : commnad because it doesn't do anything,
but I don't know if I'm using these in wrong order or
with wrong options, because althoug the filter changes
the http header content-type, it doesn't preserve the
packet's content and it sends an empty packet, so I
couldn't do anything.

I also try to configure firefox to open JPEG files
(image/jpeg) with another program (gthumb) and
although in the Preferences it appears, in fact it
doesn't do anything.

I know that ir I cant do anything with firefox, or
with this filter I must do another filter in perl, but
I don't know perl, so i'm looking for someone who can
help me and give me an example or sth to start with
it.
I hope someone can help me.
Thanks a lot.
Leire



		
______________________________________________
Renovamos el Correo Yahoo!: ¡100 MB GRATIS!
Nuevos servicios, más seguridad
http://correo.yahoo.es

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: help:filter to change http header

Posted by Stas Bekman <st...@stason.org>.
Leire Cristobo wrote:
> Hello, 
> I have to change the mime-type of a file, when it's
> requested from a client through my reverse proxy.
> Because I think that it's the only way to open this
> file (JPG) with a program different from mozilla or
> firefox.
> 
> I'm trying to change the field Content-Type of http
> header using apache 2.0 with mod_proxy,
> mod_proxy_http, mod_rewrite and mod_ext_filter.

Try using:
http://search.cpan.org/dist/Apache-Filter-HTTPHeadersFixup/


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html