W3C home > Mailing lists > Public > www-validator-cvs@w3.org > November 2009

validator/httpd/cgi-bin check,1.740,1.741

From: Ville Skytta via cvs-syncmail <cvsmail@w3.org>
Date: Sun, 29 Nov 2009 20:38:19 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1NEqXD-00039q-NO@lionel-hutz.w3.org>
Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv12124/httpd/cgi-bin

Modified Files:
	check 
Log Message:
Avoid modifying global $ENV{HTTP_AUTHORIZATION} to hush a perlcritic warning.

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.740
retrieving revision 1.741
diff -u -d -r1.740 -r1.741
--- check	29 Nov 2009 19:27:27 -0000	1.740
+++ check	29 Nov 2009 20:38:17 -0000	1.741
@@ -1722,17 +1722,17 @@
 
     # All Apache configurations don't set HTTP_AUTHORIZATION for CGI scripts.
     # If we're under mod_perl, there is a way around it...
+    my $http_auth = $ENV{HTTP_AUTHORIZATION};
     eval {
         local $SIG{__DIE__} = undef;
         my $auth =
             Apache2::RequestUtil->request()->headers_in()->{Authorization};
-        $ENV{HTTP_AUTHORIZATION} = $auth if $auth;
-    } if (IS_MODPERL2() && !$ENV{HTTP_AUTHORIZATION});
+        $http_auth = $auth if $auth;
+    } if (IS_MODPERL2() && !$http_auth);
 
     # If we got a Authorization header, the client is back at it after being
     # prompted for a password so we insert the header as is in the request.
-    $req->headers->header(Authorization => $ENV{HTTP_AUTHORIZATION})
-        if $ENV{HTTP_AUTHORIZATION};
+    $req->headers->header(Authorization => $http_auth) if $http_auth;
 
     my $res = $ua->request($req);
 
Received on Sunday, 29 November 2009 20:38:21 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:40 UTC