You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@liege.ICS.UCI.EDU> on 1996/10/02 03:24:50 UTC

Re: Things to do for 1.2beta release

> Features:
>   I think it's time for a Feature Freeze (tm) for 1.2... Votes?

I would still like a couple features, but don't have the time to
code them myself.  These are easy additions for people who are used
to working on these parts of the server:

  1) The ability to set the Cache-Control header by directory/location/file
     This could be done like mod_expires, but we may be better served by
     a general directive, a la

         HeaderSet <field-name> <field-content...>
         HeaderAppend <field-name> <field-content...>
         HeaderRemove <field-name>

     as an alternative to the cern_meta mechanism.

  2) The ability to send 410 Gone via mod_rewrite or mod_alias.
     It is just another form of redirect.  Actually, I would prefer
     that mod_rewrite be able to send *any* status code by internal
     redirection to the response content and a [nnn] at the end of
     the rule indicating the final status.

These fall under the category of "why HTTP/1.1 is better than HTTP/1.0"
and thus would be big selling points.

.....Roy

Re: set/unset Headers

Posted by Brian Behlendorf <br...@organic.com>.
On Mon, 7 Oct 1996, Alexei Kosut wrote:
> On Mon, 7 Oct 1996, Brian Behlendorf wrote:
> 
> > +1 on adding TAKE23 to http_config.c.
> 
> Whatever happened to my patch that added TAKE12, NCSA-style auth
> directives, and the ability to have a command handler decline? I
> thought it was kinda useful (even without the NCSA-compat stuff).

it's still in my to-go-through queue.  I wouldn't mind if Apache 1.2 was able
to handle all NCSA auth-directives, if it can be logically reconciled.  

	Brian

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com  www.apache.org  hyperreal.com  http://www.organic.com/JOBS


Re: set/unset Headers

Posted by Paul Sutton <pa...@ukweb.com>.
On Mon, 7 Oct 1996, Alexei Kosut wrote:
> On Mon, 7 Oct 1996, Brian Behlendorf wrote:
> > +1 on adding TAKE23 to http_config.c.
>
> Whatever happened to my patch that added TAKE12, NCSA-style auth
> directives, and the ability to have a command handler decline? I
> thought it was kinda useful (even without the NCSA-compat stuff).

For what it's worth, I tested this at the time and I think it should both
be committed.

Paul
UK Web Ltd


Re: set/unset Headers

Posted by Alexei Kosut <ak...@nueva.pvt.k12.ca.us>.
On Mon, 7 Oct 1996, Brian Behlendorf wrote:

> +1 on adding TAKE23 to http_config.c.

Whatever happened to my patch that added TAKE12, NCSA-style auth
directives, and the ability to have a command handler decline? I
thought it was kinda useful (even without the NCSA-compat stuff).

-- 
________________________________________________________________________
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/


Re: set/unset Headers

Posted by Brian Behlendorf <br...@organic.com>.
+1 on adding TAKE23 to http_config.c.

	Brian

On Mon, 7 Oct 1996, Paul Sutton wrote:
> Because Header can take two _or_ three arguments, I've had to update
> http_config.[ch] to support a new TAKE23 mode. I'll append this patch
> below.
> 
> Paul
> UK Web Ltd
> 
> diff -c ../src/http_config.c ./http_config.c
> *** ../src/http_config.c	Mon Sep 23 09:21:03 1996
> --- ./http_config.c	Sun Oct  6 23:20:20 1996
> ***************
> *** 401,407 ****
> 
>   char *invoke_cmd(command_rec *cmd, cmd_parms *parms, void *mconfig, char *args)
>   {
> !     char *w, *w2, *errmsg;
> 
>       if ((parms->override & cmd->req_override) == 0)
>           return pstrcat (parms->pool, cmd->name, " not allowed here", NULL);
> --- 401,407 ----
> 
>   char *invoke_cmd(command_rec *cmd, cmd_parms *parms, void *mconfig, char *args)
>   {
> !     char *w, *w2, *w3, *errmsg;
> 
>       if ((parms->override & cmd->req_override) == 0)
>           return pstrcat (parms->pool, cmd->name, " not allowed here", NULL);
> ***************
> *** 439,444 ****
> --- 439,459 ----
>   			    cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL);
> 
>   	return (*cmd->func) (parms, mconfig, w, w2);
> +
> +     case TAKE23:
> +
> + 	w = getword_conf (parms->pool, &args);
> + 	w2 = getword_conf (parms->pool, &args);
> + 	if (*args)
> + 	  w3 = getword_conf (parms->pool, &args);
> + 	else
> + 	  w3 = NULL;
> +
> + 	if (*w == '\0' || *w2 == '\0' || *args != 0)
> + 	    return pstrcat (parms->pool, cmd->name, " takes three arguments",
> + 			    cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL);
> +
> + 	return (*cmd->func) (parms, mconfig, w, w2, w3);
> 
>       case ITERATE:
> 
> diff -c ../src/http_config.h ./http_config.h
> *** ../src/http_config.h	Thu Aug 22 08:36:46 1996
> --- ./http_config.h	Mon Oct  7 00:11:04 1996
> ***************
> *** 62,67 ****
> --- 62,68 ----
>     RAW_ARGS,			/* cmd_func parses command line itself */
>     TAKE1,			/* one argument only */
>     TAKE2,			/* two arguments only */
> +   TAKE23,			/* two or three arguments */
>     ITERATE,			/* one argument, occuring multiple times
>   				 * (e.g., IndexIgnore)
>   				 */
> 
> 
> 

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com  www.apache.org  hyperreal.com  http://www.organic.com/JOBS


set/unset Headers

Posted by Paul Sutton <pa...@ukweb.com>.
On Tue, 1 Oct 1996, Roy T. Fielding wrote:
>   1) The ability to set the Cache-Control header by directory/location/file
>      This could be done like mod_expires, but we may be better served by
>      a general directive, a la
>
>          HeaderSet <field-name> <field-content...>
>          HeaderAppend <field-name> <field-content...>
>          HeaderRemove <field-name>

I've put together a module which implements header setting/removing.  It
is called mod_headers.c, add I've uploaded it by ftp to hyperreal.com in
httpd/incoming/mod_headers.c.

It adds a new directive, Header, which can be used to add, append or
remove HTTP headers, e.g.

   Header set Cache-Control: max-age=84000
   Header append Connection: some-new-thing
   Header set Author "John D. Doe"
   Header unset MyBadHeader

The directives can be given for the main server, virtual servers, in
<Directory> sections/.htaccess files, <Location> sections and <Files>
sections. They are applied in that order (so .htacess files can override
settings in main or virtual server configs). The headers are always
merged, so that anything set in (say) the main server config always
applies, even if other more Header directives are given in a virtual host.
Of course, for example, the virtual host can remove a header set in the
main server with Header unset.

It could be used to set a header for all files in a directory
(via .htaccess) or individual files (with <Files> say):

  <Files ~ .*\.gif>
  Header set Cache-Control: max-age=84000
  </Files>

It operates in the 'fixup' stage of the request, which means it does not
affect headers added during the handler phase (in particular, headers like
Server, Date, Last-Modified, ETag). If any of these are set by a Header
directive, they will be added as a duplicate header during the handler
phase. It might be worth explicitly disallowing the setting of these
headers by Header.

Because Header can take two _or_ three arguments, I've had to update
http_config.[ch] to support a new TAKE23 mode. I'll append this patch
below.

Paul
UK Web Ltd

diff -c ../src/http_config.c ./http_config.c
*** ../src/http_config.c	Mon Sep 23 09:21:03 1996
--- ./http_config.c	Sun Oct  6 23:20:20 1996
***************
*** 401,407 ****

  char *invoke_cmd(command_rec *cmd, cmd_parms *parms, void *mconfig, char *args)
  {
!     char *w, *w2, *errmsg;

      if ((parms->override & cmd->req_override) == 0)
          return pstrcat (parms->pool, cmd->name, " not allowed here", NULL);
--- 401,407 ----

  char *invoke_cmd(command_rec *cmd, cmd_parms *parms, void *mconfig, char *args)
  {
!     char *w, *w2, *w3, *errmsg;

      if ((parms->override & cmd->req_override) == 0)
          return pstrcat (parms->pool, cmd->name, " not allowed here", NULL);
***************
*** 439,444 ****
--- 439,459 ----
  			    cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL);

  	return (*cmd->func) (parms, mconfig, w, w2);
+
+     case TAKE23:
+
+ 	w = getword_conf (parms->pool, &args);
+ 	w2 = getword_conf (parms->pool, &args);
+ 	if (*args)
+ 	  w3 = getword_conf (parms->pool, &args);
+ 	else
+ 	  w3 = NULL;
+
+ 	if (*w == '\0' || *w2 == '\0' || *args != 0)
+ 	    return pstrcat (parms->pool, cmd->name, " takes three arguments",
+ 			    cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL);
+
+ 	return (*cmd->func) (parms, mconfig, w, w2, w3);

      case ITERATE:

diff -c ../src/http_config.h ./http_config.h
*** ../src/http_config.h	Thu Aug 22 08:36:46 1996
--- ./http_config.h	Mon Oct  7 00:11:04 1996
***************
*** 62,67 ****
--- 62,68 ----
    RAW_ARGS,			/* cmd_func parses command line itself */
    TAKE1,			/* one argument only */
    TAKE2,			/* two arguments only */
+   TAKE23,			/* two or three arguments */
    ITERATE,			/* one argument, occuring multiple times
  				 * (e.g., IndexIgnore)
  				 */