Subject: | [PATCH] url.t help for VMS |
On VMS, %ENV as a whole cannot be localized and in fact any script that tries to do that won't
even compile. The attached patch takes care of that problem for url.t by localizing each %ENV
element of interest individually.
Subject: | vms_cgi_url_t.patch |
--- t/url.t;-0 2011-11-09 16:31:14 -0600
+++ t/url.t 2011-11-11 22:58:04 -0600
@@ -25,20 +25,23 @@ is url() => 'http://proxy', 'url() with
subtest 'rewrite_interactions' => sub {
# Reference: RT#45019
- local %ENV = (
- # These two are always set
- 'SCRIPT_NAME' => '/real/cgi-bin/dispatch.cgi',
- 'SCRIPT_FILENAME' => '/home/mark/real/path/cgi-bin/dispatch.cgi',
-
- # These two are added by mod_rewrite Ref: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
-
- 'SCRIPT_URL' => '/real/path/info',
- 'SCRIPT_URI' => 'http://example.com/real/path/info',
-
- 'PATH_INFO' => '/path/info',
- 'REQUEST_URI' => '/real/path/info',
- 'HTTP_HOST' => 'example.com'
- );
+ local $ENV{HTTP_X_FORWARDED_HOST} = undef;
+ local $ENV{SERVER_PROTOCOL} = undef;
+ local $ENV{SERVER_PORT} = undef;
+ local $ENV{SERVER_NAME} = undef;
+
+ # These two are always set
+ local $ENV{'SCRIPT_NAME'} = '/real/cgi-bin/dispatch.cgi';
+ local $ENV{'SCRIPT_FILENAME'} = '/home/mark/real/path/cgi-bin/dispatch.cgi';
+
+ # These two are added by mod_rewrite Ref: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
+
+ local $ENV{'SCRIPT_URL'} = '/real/path/info';
+ local $ENV{'SCRIPT_URI'} = 'http://example.com/real/path/info';
+
+ local $ENV{'PATH_INFO'} = '/path/info';
+ local $ENV{'REQUEST_URI'} = '/real/path/info';
+ local $ENV{'HTTP_HOST'} = 'example.com';
my $q = CGI->new;