W3C home > Mailing lists > Public > www-validator-cvs@w3.org > August 2010

link-checker commit: Check redirects for private IP addresses too.

From: Mercurial notifier <nobody@w3.org>
Date: Thu, 05 Aug 2010 14:47:02 +0000
To: link-checker updates <www-validator-cvs@w3.org>
Message-Id: <E1Oh1io-0005iv-TD@blinky.w3.org>
changeset:   117:5db5e61bf6e8
user:        ville
date:        Sat Feb 05 18:48:20 2005 +0000
files:       bin/checklink
description:
Check redirects for private IP addresses too.


diff -r 23ed8710ac7a -r 5db5e61bf6e8 bin/checklink
--- a/bin/checklink	Sun Jan 09 20:43:36 2005 +0000
+++ b/bin/checklink	Sat Feb 05 18:48:20 2005 +0000
@@ -5,7 +5,7 @@
 # (c) 1999-2005 World Wide Web Consortium
 # based on Renaud Bruyeron's checklink.pl
 #
-# $Id: checklink,v 4.15 2005-01-09 20:43:36 ville Exp $
+# $Id: checklink,v 4.16 2005-02-05 18:48:20 ville Exp $
 #
 # This program is licensed under the W3C(r) Software License:
 #       http://www.w3.org/Consortium/Legal/copyright-software
@@ -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;
 }
 
 # -----------------------------------------------------------------------------
@@ -110,7 +118,7 @@
   $PROGRAM     = 'W3C-checklink';
   $VERSION     = '4.1';
   $REVISION    = sprintf('version %s (c) 1999-2005 W3C', $VERSION);
-  my ($cvsver) = q$Revision: 4.15 $ =~ /(\d+[\d\.]*\.\d+)/;
+  my ($cvsver) = q$Revision: 4.16 $ =~ /(\d+[\d\.]*\.\d+)/;
   $AGENT       = sprintf('%s/%s [%s] %s',
                          $PROGRAM, $VERSION, $cvsver, LWP::RobotUA->_agent());
 
Received on Thursday, 5 August 2010 14:47:15 UTC

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