httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <>
Subject Re: slight API change
Date Mon, 18 Mar 1996 00:16:40 GMT
On Sun, 17 Mar 1996, David Robinson wrote:

> What you are trying to do is force particular action for all files in
> a particular directory. What I was trying to do was seperate actions from

Right. Though not limited to directories, per se, but to any given URI
pattern independent of file type. To use my previous example, an FTP proxy
could use the uri-to-filename process to set the handler to "ftp-proxy" or
whatnot, and then use the media-type-finding phase to find out the content

> document types. Unfortunately, your implementation of the former is only
> a partial solution to the latter.
> Now if you had implemented a ForceType directive, which fixed the mime
> type for all files in a directory, e.g.
> ForceType application/x-httpd-cgi /cgi-bin
> Then I wouldn't have made the confusion. (This directive, BTW, could
> be made functionally equivalent to your AddHandler directive, but without
> introducing any new concepts.)

Right. I wasn't actually looking, though, at doing anything with it at 
the time, just putting it in there for future use. Though at the soonest 
possibility I plan to change ScriptAlias to use it.

> Now, your AddHandler directive only goes part way to implementing this; the

Just a note - I wasn't really saying that there should be such a 
directive, just giving an example.

> case where the action is deduced from the directory containing the file.
> It does not implement the case where the action is deduced from the filename
> itself; _that_ was what I was 'complaining' about. To get rid of magic
> mime types, we need both parts of the solution. Clearly, in my message
> of December I neglected the part that you have now fixed.

Okay. I'll agree with that.

> Getting this right would mean, for example, that the nastiness that
> is text/x-server-parsed-html3 would be solved; the property of a file
> that it is a server-parsed file would be determined seperately from the
> html version of the file.


> So what we need is a mapping from file extension to handler.

Oh! I think I see what you're saying (finally). Sort of like with
languages, being seperate from media types. So, for example, you could
have a file named foo.html.parsed, or foo.txt.parsed, or whatnot. Is that
what you mean? If so, it makes a lot of sense. I think it could be done
rather easily: Modify mod_mime.c, so in addition to checking for media
types and languages and encodings, it also checks for handlers (added with
an AddHandler directive). If it finds one, it sets r->handler to it, just
as it sets r->content_type, r->content_language and r->content_encoding to
the other filename extensions.

I think that would accomplish what you want. Seems a very simple patch.

--// Alexei Kosut // <> // Lefler on IRC --//
-----------------// <> -------// 
"To get the full effect of Pat Buchanan's speeches, they should be
read in the original German." //--------------------------------------

View raw message