stas 2003/09/22 16:39:49
Modified: src/modules/perl modperl_config.c
. Changes
Log:
fix a bug where %ENV vars set via subprocess_env persist across
requests. (e.g. a Cookie incoming header which ends up in
$ENV{HTTP_COOKIE} would persist to the next request which has no
Cookie header at all). Now we unset all the %ENV vars set from
subprocess_env. Improve and extend the tests to cover this bug.
Revision Changes Path
1.66 +7 -1 modperl-2.0/src/modules/perl/modperl_config.c
Index: modperl_config.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -u -r1.65 -r1.66
--- modperl_config.c 19 Aug 2003 05:01:22 -0000 1.65
+++ modperl_config.c 22 Sep 2003 23:39:49 -0000 1.66
@@ -291,7 +291,13 @@
}
retval = modperl_callback_per_dir(MP_CLEANUP_HANDLER, r, MP_HOOK_RUN_ALL);
-
+
+ /* undo changes to %ENV caused by +SetupEnv, perl-script, or
+ * $r->subprocess_env, so the values won't persist */
+ if (MpReqSETUP_ENV(rcfg)) {
+ modperl_env_request_unpopulate(aTHX_ r);
+ }
+
return retval;
}
1.218 +6 -0 modperl-2.0/Changes
Index: Changes
===================================================================
RCS file: /home/cvs/modperl-2.0/Changes,v
retrieving revision 1.217
retrieving revision 1.218
diff -u -u -r1.217 -r1.218
--- Changes 18 Sep 2003 08:48:31 -0000 1.217
+++ Changes 22 Sep 2003 23:39:49 -0000 1.218
@@ -12,6 +12,12 @@
=item 1.99_10-dev
+fix a bug where %ENV vars set via subprocess_env persist across
+requests. (e.g. a Cookie incoming header which ends up in
+$ENV{HTTP_COOKIE} would persist to the next request which has no
+Cookie header at all). Now we unset all the %ENV vars set from
+subprocess_env. Improve and extend the tests to cover this bug. [Stas]
+
it is invalid to return HTTP_INTERNAL_SERVER_ERROR or any other HTTP
response code from modperl_wbucket_pass, therefore set the error code
into r->status and return APR_SUCCESS. Untill now response handler