Changes with Apache 2.4.7
+ *) mod_headers: Add 'Header note header-name note-name' for copying a response
+ headers value into a note. [Eric Covener]
+
*) mod_headers: Add 'setifempty' command to Header and RequestHeader.
[Eric Covener]
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * mod_headers: Add 'Header note header-name note-name' to copy a headers
- value into a note (so a CGI/Proxy header can be deleted and logged)
- trunk patch: http://svn.apache.org/r1520908
- 2.4.x patch: trunk works, if 1496338 above is merged first.
- +1: covener, jim, humbedooh
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
<directivesynopsis>
<name>Header</name>
<description>Configure HTTP response headers</description>
-<syntax>Header [<var>condition</var>] add|append|echo|edit|edit*|merge|set|unset
+<syntax>Header [<var>condition</var>] add|append|echo|edit|edit*|merge|set|unset|note
<var>header</var> [<var>value</var>] [<var>replacement</var>]
[early|env=[!]<var>variable</var>]|expr=<var>expression</var>]
</syntax>
<dd>The response header of this name is removed, if it exists.
If there are multiple headers of the same name, all will be
removed. <var>value</var> must be omitted.</dd>
+
+ <dt><code>note</code></dt>
+ <dd>The value of the named response <var>header</var> is copied into an
+ internal note whose name is given by <var>value</var>. This is useful
+ if a header sent by a CGI or proxied resource is configured to be unset
+ but should also be logged.</dd>
+
</dl>
<p>This argument is followed by a <var>header</var> name, which
hdr_unset = 'u', /* unset header */
hdr_echo = 'e', /* echo headers from request to response */
hdr_edit = 'r', /* change value by regexp, match once */
- hdr_edit_r = 'R', /* change value by regexp, everymatch */
- hdr_setifempty = 'i' /* set value if header not already present*/
+ hdr_edit_r = 'R', /* change value by regexp, everymatch */
+ hdr_setifempty = 'i', /* set value if header not already present*/
+ hdr_note = 'n' /* set value of header in a note */
} hdr_actions;
/*
new->action = hdr_edit;
else if (!strcasecmp(action, "edit*"))
new->action = hdr_edit_r;
+ else if (!strcasecmp(action, "note"))
+ new->action = hdr_note;
else
return "first argument must be 'add', 'set', 'setifempty', 'append', 'merge', "
- "'unset', 'echo', 'edit', or 'edit*'.";
+ "'unset', 'echo', 'note', 'edit', or 'edit*'.";
if (new->action == hdr_edit || new->action == hdr_edit_r) {
if (subs == NULL) {
apr_table_do(add_them_all, (void *) headers, ed.t, NULL);
}
break;
+ case hdr_note:
+ apr_table_setn(r->notes, process_tags(hdr, r), apr_table_get(headers, hdr->header));
+ break;
+
}
}
return 1;