You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@znep.com> on 1997/06/30 05:59:03 UTC

handlers and content-type and multiple extensions

If I have a file called foo.cgi.html and have:

	AddHandler cgi-script .cgi

then mod_mime will go through, set the handler to cgi-script, set the
content-type to text/html, then try to execute the script.

If I have an

	AddType cgi-script .cgi

instead, it will display it as a text/html because the content-type will
be replaced by the last extension.  This seems somewhat bogus to me...
what is the intent behind doing things like this?


Re: handlers and content-type and multiple extensions

Posted by Alexei Kosut <ak...@nueva.pvt.k12.ca.us>.
On Sun, 29 Jun 1997, Marc Slemko wrote:

> If I have a file called foo.cgi.html and have:
> 
> 	AddHandler cgi-script .cgi
> 
> then mod_mime will go through, set the handler to cgi-script, set the
> content-type to text/html, then try to execute the script.
> 
> If I have an
> 
> 	AddType cgi-script .cgi
> 
> instead, it will display it as a text/html because the content-type will
> be replaced by the last extension.  This seems somewhat bogus to me...
> what is the intent behind doing things like this?

AddHandler server-parsed ssi

foo.html.ssi will be parsed, and returned as text/html. foo.txt.ssi
will be parsed, and returned as text/plain. You're not supposed to be
assigned handlers as a type, anyway. It's not legal. AddType should
really check for a /.

Or maybe I'm reading your message wrong. Are you asking why AddHandler
behaves as it does, or why AddType does? AddType behaves like that
because a document can have only one media type, and it uses the last
one... AddHandler behaves as it does because handlers and media types
are seperate. See above for why.

-- 
________________________________________________________________________
Alexei Kosut <ak...@nueva.pvt.k12.ca.us>      The Apache HTTP Server
URL: http://www.nueva.pvt.k12.ca.us/~akosut/   http://www.apache.org/