Changes with Apache 1.3.27
+ *) Included a patch submitted by Sander van Zoest (#9181) and
+ written by Michael Radwin whichs is essentially a work around
+ for the adding headers to error responses. As apache does not
+ go through the proper chain for non 2xx responses. This patch
+ adds an ErrorHeader directive; which is for non 2xx replies the
+ direct analog of the existing Header directive. This is usefull
+ during 3xx redirects or more complex 4xx auth schemes. [Dirk-
+ Willem van Gulik]
+
*) Included the patch submitted by Sander van Zoest (#12712) which
prevents just 'anything' being sucked in when doing gobbeling in
complete directories - such as editor backup files and other
hdr_actions action;
char *header;
char *value;
+ int do_err;
} header_entry;
/*
return a;
}
-
static const char *header_cmd(cmd_parms *cmd, headers_conf * dirconf, char *action, char *hdr, char *value)
{
header_entry *new;
new = (header_entry *) ap_push_array(serverconf->headers);
}
+ if (cmd->info) {
+ new->do_err = 1;
+ } else {
+ new->do_err = 0;
+ }
+
if (!strcasecmp(action, "set"))
new->action = hdr_set;
else if (!strcasecmp(action, "add"))
static const command_rec headers_cmds[] =
{
- {"Header", header_cmd, NULL, OR_FILEINFO, TAKE23,
+ {"Header", header_cmd, (void *)0, OR_FILEINFO, TAKE23,
+ "an action, header and value"},
+ {"ErrorHeader", header_cmd, (void *)1, OR_FILEINFO, TAKE23,
"an action, header and value"},
{NULL}
};
for (i = 0; i < headers->nelts; ++i) {
header_entry *hdr = &((header_entry *) (headers->elts))[i];
+ table *tbl = (hdr->do_err ? r->err_headers_out : r->headers_out);
switch (hdr->action) {
case hdr_add:
- ap_table_addn(r->headers_out, hdr->header, hdr->value);
+ ap_table_addn(tbl, hdr->header, hdr->value);
break;
case hdr_append:
- ap_table_mergen(r->headers_out, hdr->header, hdr->value);
+ ap_table_mergen(tbl, hdr->header, hdr->value);
break;
case hdr_set:
- ap_table_setn(r->headers_out, hdr->header, hdr->value);
+ ap_table_setn(tbl, hdr->header, hdr->value);
break;
case hdr_unset:
- ap_table_unset(r->headers_out, hdr->header);
+ ap_table_unset(tbl, hdr->header);
break;
}
}