W3C home > Mailing lists > Public > www-validator-cvs@w3.org > February 2005

perl/modules/W3C/LinkChecker/bin checklink,4.15,4.16

From: Ville Skytta <ville@dev.w3.org>
Date: Sat, 05 Feb 2005 18:48:23 +0000
To: www-validator-cvs@w3.org
Message-ID: <E1CxUyl-0002g1-1A@lionel-hutz.w3.org>

Update of /sources/public/perl/modules/W3C/LinkChecker/bin
In directory hutz:/tmp/cvs-serv10275/bin

Modified Files:
	checklink 
Log Message:
Check redirects for private IP addresses too.

Index: checklink
===================================================================
RCS file: /sources/public/perl/modules/W3C/LinkChecker/bin/checklink,v
retrieving revision 4.15
retrieving revision 4.16
diff -u -d -r4.15 -r4.16
--- checklink	9 Jan 2005 20:43:36 -0000	4.15
+++ checklink	5 Feb 2005 18:48:20 -0000	4.16
@@ -78,7 +78,15 @@
     # robust way of determining whether something is a LWP "internal" request.
     &W3C::LinkChecker::hprintf("\n%s %s ", $request->method(),$request->uri());
   }
-  return $self->SUPER::redirect_ok($request, $response);
+  return 0 unless $self->SUPER::redirect_ok($request, $response);
+  if (my $res = &W3C::LinkChecker::ip_allowed($request->uri())) {
+    $response->previous($response->clone());
+    $response->request($request);
+    $response->code($res->code());
+    $response->message($res->message());
+    return 0;
+  }
+  return 1;
 }
 
 # -----------------------------------------------------------------------------
Received on Saturday, 5 February 2005 18:48:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:54:48 GMT