You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Eric Jain <ja...@gmx.net> on 2000/05/07 22:55:38 UTC
Content negotiation headers
How do I suppress content negotiation headers?
I am using my own handler to convert XML to HTML on the fly:
http://biodoc.ch/de/forum/2000/1/01.xml ->
HTTP/1.1 200 OK
Date: Sun, 07 May 2000 20:40:52 GMT
Server: Apache/1.3.9 (Unix) (SuSE/Linux) mod_perl/1.21 mod_ssl/2.4.7
OpenSSL/0.9.4
Connection: close
Content-Type: text/html
Perfect, except that I would like to hide the file ending. Enter
mod_negotiotion:
http://biodoc.ch/de/forum/2000/1/01 ->
HTTP/1.1 200 OK
Date: Sun, 07 May 2000 20:40:21 GMT
Server: Apache/1.3.9 (Unix) (SuSE/Linux) mod_perl/1.21 mod_ssl/2.4.7
OpenSSL/0.9.4
Content-Location: 01.xml
Vary: negotiate
TCN: choice
Connection: close
Content-Type: text/html
This will obviously not be cached by any proxies :-(
So how do I get rid of Content-Location, Vary and TCN?
--Eric Jain
Re: Content negotiation headers
Posted by Matt Sergeant <ma...@sergeant.org>.
On Sun, 7 May 2000, Eric Jain wrote:
> How do I suppress content negotiation headers?
Don't use mod_negotiation!
> I am using my own handler to convert XML to HTML on the fly:
>
> http://biodoc.ch/de/forum/2000/1/01.xml ->
>
> HTTP/1.1 200 OK
> Date: Sun, 07 May 2000 20:40:52 GMT
> Server: Apache/1.3.9 (Unix) (SuSE/Linux) mod_perl/1.21 mod_ssl/2.4.7
> OpenSSL/0.9.4
> Connection: close
> Content-Type: text/html
>
> Perfect, except that I would like to hide the file ending. Enter
> mod_negotiotion:
>
> http://biodoc.ch/de/forum/2000/1/01 ->
>
> HTTP/1.1 200 OK
> Date: Sun, 07 May 2000 20:40:21 GMT
> Server: Apache/1.3.9 (Unix) (SuSE/Linux) mod_perl/1.21 mod_ssl/2.4.7
> OpenSSL/0.9.4
> Content-Location: 01.xml
> Vary: negotiate
> TCN: choice
> Connection: close
> Content-Type: text/html
>
> This will obviously not be cached by any proxies :-(
>
> So how do I get rid of Content-Location, Vary and TCN?
Install a handler that sets $r->filename:
$r->filename($r->filename . '.xml') if -e ($r->filename . '.xml');
(note that AxKit can do all this for you, and comes with a FileSuffix
style chooser which does similar to what you're after).
--
<Matt/>
Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org