You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ia...@apache.org on 2001/11/07 20:25:33 UTC
cvs commit: httpd-2.0/docs/manual/mod mod_headers.html
ianh 01/11/07 11:25:33
Modified: modules/metadata mod_headers.c
docs/manual/mod mod_headers.html
Log:
add a new option '%{note-name}e' to headers.
This will output the value of the note (subprocess_env) into a header field
Revision Changes Path
1.34 +16 -2 httpd-2.0/modules/metadata/mod_headers.c
Index: mod_headers.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_headers.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- mod_headers.c 2001/06/06 10:43:46 1.33
+++ mod_headers.c 2001/11/07 19:25:33 1.34
@@ -188,7 +188,15 @@
{
return apr_psprintf(r->pool, "t=%qd", r->request_time);
}
-
+static const char *header_request_env_var(request_rec *r, char *a)
+{
+ char *s = apr_table_get(r->subprocess_env,a);
+
+ if (s)
+ return s;
+ else
+ return "(null)";
+}
/*
* Config routines
*/
@@ -289,6 +297,12 @@
return parse_misc_string(p, tag, sa);
}
s++; /* skip the % */
+ tag->arg = '\0';
+ /* grab the argument if there is one */
+ if (*s == '{') {
+ ++s;
+ tag->arg = ap_getword(p,&s,'}');
+ }
tag_handler = (const char * (*)(request_rec *,char *))apr_hash_get(format_tag_hash, s++, 1);
@@ -302,7 +316,6 @@
tag->func = tag_handler;
*sa = s;
- tag->arg = '\0';
return NULL;
}
@@ -597,6 +610,7 @@
format_tag_hash = apr_hash_make(p);
register_format_tag_handler(p, "D", (void*) header_request_duration, 0);
register_format_tag_handler(p, "t", (void*) header_request_time, 0);
+ register_format_tag_handler(p, "e", (void*) header_request_env_var, 0);
}
static void register_hooks(apr_pool_t *p)
1.22 +2 -0 httpd-2.0/docs/manual/mod/mod_headers.html
Index: mod_headers.html
===================================================================
RCS file: /home/cvs/httpd-2.0/docs/manual/mod/mod_headers.html,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- mod_headers.html 2001/09/22 19:36:01 1.21
+++ mod_headers.html 2001/11/07 19:25:33 1.22
@@ -277,6 +277,8 @@
%D: The time from when the request was received to the time the
headers are sent on the wire. This is a measure of the
duration of the request. The value is preceded by "D=".
+%{NOTE-NAME}e: The value of the note 'NOTE-NAME' (set via
+ mod_include's set SSI command)
</pre>
<p>When the <code>Header</code> directive is used with the