There is another function, ap_add_cgi_vars(), in server/util_script.c which sets REQUEST_URI, SCRIPT_NAME, and all the other CGI variables we are accustomed to. It looks like mod_ext_filter calls ap_add_cgi_vars() but not ap_add_common_vars().
see attached patch :)
Index: modules/filters/mod_ext_filter.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/filters/mod_ext_filter.c,v
retrieving revision 1.6
diff -u -r1.6 mod_ext_filter.c
--- modules/filters/mod_ext_filter.c 1 Jul 2003 11:21:00 -0000 1.6
+++ modules/filters/mod_ext_filter.c 11 Jul 2003 22:43:34 -0000
@@ -490,6 +490,7 @@
* and QUERY_STRING_UNESCAPED
*/
ap_add_cgi_vars(f->r);
+ ap_add_common_vars(f->r);
apr_table_setn(f->r->subprocess_env, "DOCUMENT_URI", f->r->uri);
apr_table_setn(f->r->subprocess_env, "DOCUMENT_PATH_INFO", f->r->path_info);
if (f->r->args) {
