%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
{
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
*/
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);
tag->func = tag_handler;
*sa = s;
- tag->arg = '\0';
return NULL;
}
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)