W3C home > Mailing lists > Public > www-validator-cvs@w3.org > March 2011

link-checker commit: Use GET more eagerly to avoid some throwaway HEAD results when recursing.

From: Mercurial notifier <nobody@w3.org>
Date: Tue, 22 Mar 2011 20:34:01 +0000
Message-Id: <E1Q28HB-0005cS-JP@mcbain.w3.org>
To: link-checker updates <www-validator-cvs@w3.org>
changeset:   391:e0644feb2f38
user:        Ville Skyttä <ville.skytta@iki.fi>
date:        Tue Mar 22 21:27:00 2011 +0200
files:       bin/checklink
description:
Use GET more eagerly to avoid some throwaway HEAD results when recursing.


diff -r 20e62a9e944f -r e0644feb2f38 bin/checklink
--- a/bin/checklink	Tue Mar 22 21:01:43 2011 +0200
+++ b/bin/checklink	Tue Mar 22 21:27:00 2011 +0200
@@ -2165,11 +2165,10 @@
     # $links is a hash of the links in the documents checked
     # $redirects is a map of the redirects encountered
 
-    # Get the document with the appropriate method
-    # Only use GET if there are fragments. HEAD is enough if it's not the
-    # case.
+    # Get the document with the appropriate method: GET if there are
+    # fragments to check or links are wanted, HEAD is enough otherwise.
     my $fragments = $links->{$uri}{fragments} || {};
-    my $method = scalar(%$fragments) ? 'GET' : 'HEAD';
+    my $method = ($want_links || %$fragments) ? 'GET' : 'HEAD';
 
     my $response;
     my $being_processed = 0;
Received on Tuesday, 22 March 2011 20:34:02 UTC

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