httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@ai.mit.edu (Robert S. Thau)
Subject New patch on ftp.apache.org --- E70_add_handler
Date Sun, 16 Apr 1995 17:31:28 GMT
I've coded up the AddHandler directive which a bunch of people have
been bouncing around --- to see it in action, if the crackers haven't
brought down our server *again* yet, take a gander at:

  http://www.ai.mit.edu/site.idx

If this patch causes anyone any problems, it obviously should not be
in beta one.  However it's a nice feature, with a lot of applications,
and if it *doesn't* cause any problems, I'd like to see it in.  Please
try it.

Note that this patch conflicts with B57 in the current incarnation of
the latter, since it wants to call unmunge_name at various times on
both the handler name and the document name.

Documentation follows (info on files changed, also included with the patch):



This patch adds the AddHandler directive to srm.conf ---

  AddHandler mime/type /cgi-script/name

When the server gets a request to GET (or POST to) a file with the
type mime/type, the CGI script is invoked.  The environment of the
script is more or less as if the document were a server-side included
document which included the script.  In particular, the following
environment vairables are set in addition to the normal CGI set:

  DOCUMENT_URI (URI of document)
  DOCUMENT_NAME (last entry on pathname)
  DOCUMENT_TRANSLATED (location of document in the file system)

The last is an includes variable new with this patch, which is available
to scripts invoked via <!--#exec cgi--> from a real includes document as
well.

If a handler is declared for the pseudo-mime-type httpd/unix-directory,
that handler will be invoked instead of the internal directory-indexing
machinery if the files named in the DirectoryIndex directive are
unavailable.

(Note that the server requires PATH_INFO of '/' when actually invoking
httpd/unix-directory handlers --- sending out a redirect as usual
otherwise --- so the handler can generate HTML which looks like:

  <a href="file_in_dir.foo">some file in this directory</a>

without worry).

Mime
View raw message