httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r1523271 - in /httpd/httpd/branches/2.4.x: ./ CHANGES STATUS docs/manual/ docs/manual/mod/ docs/manual/mod/mod_headers.xml modules/metadata/mod_headers.c
Date Sat, 14 Sep 2013 15:31:36 GMT
Author: minfrin
Date: Sat Sep 14 15:31:35 2013
New Revision: 1523271

URL: http://svn.apache.org/r1523271
Log:
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

Submitted by: covener
Reviewed by: jim, humbedooh

Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/docs/manual/   (props changed)
    httpd/httpd/branches/2.4.x/docs/manual/mod/   (props changed)
    httpd/httpd/branches/2.4.x/docs/manual/mod/mod_headers.xml
    httpd/httpd/branches/2.4.x/modules/metadata/mod_headers.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1520908

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1523271&r1=1523270&r2=1523271&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Sat Sep 14 15:31:35 2013
@@ -2,6 +2,9 @@
 
 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]
 

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1523271&r1=1523270&r2=1523271&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Sat Sep 14 15:31:35 2013
@@ -97,12 +97,6 @@ RELEASE SHOWSTOPPERS:
 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 ]

Propchange: httpd/httpd/branches/2.4.x/docs/manual/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk/docs/manual:r1520908

Propchange: httpd/httpd/branches/2.4.x/docs/manual/mod/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk/docs/manual/mod:r1520908

Modified: httpd/httpd/branches/2.4.x/docs/manual/mod/mod_headers.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/mod/mod_headers.xml?rev=1523271&r1=1523270&r2=1523271&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/mod/mod_headers.xml (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/mod/mod_headers.xml Sat Sep 14 15:31:35 2013
@@ -300,7 +300,7 @@ Header merge Cache-Control no-store env=
 <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>
@@ -400,6 +400,13 @@ Header merge Cache-Control no-store env=
     <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

Modified: httpd/httpd/branches/2.4.x/modules/metadata/mod_headers.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/metadata/mod_headers.c?rev=1523271&r1=1523270&r2=1523271&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/metadata/mod_headers.c (original)
+++ httpd/httpd/branches/2.4.x/modules/metadata/mod_headers.c Sat Sep 14 15:31:35 2013
@@ -96,8 +96,9 @@ typedef enum {
     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;
 
 /*
@@ -448,9 +449,11 @@ static APR_INLINE const char *header_ino
         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) {
@@ -796,6 +799,10 @@ static int do_headers_fixup(request_rec 
                 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;



Mime
View raw message