Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 72380
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: MARKSTOS [...] cpan.org
Requestors: cberry [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 3.57
Fixed in: (no value)



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;
Subject: Re: [rt.cpan.org #72380] [PATCH] url.t help for VMS
Date: Tue, 15 Nov 2011 10:47:01 -0500
To: bug-cgi [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
This looks fine. Thanks for the contribution. Mark
Getting released today, thanks.