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

checklink: User-Agent causes HTTP error 406

From: Kevin Keane <subscription@kkeane.com>
Date: Sun, 30 Aug 2009 07:13:19 -0700
To: www-validator@w3.org
Message-ID: <4A9A88FF.1010509@kkeane.com>
On a number of Web sites, check-link returns with an HTTP error 406,
even with correct Accept header settings, and even when wget and links
can access the site without a problem.

Through trial and error, I found that on at least one site, the culprit
is the User-Agent header. Adding the line

  $request->header('User-Agent', 'W3C-linkcheck');

before line 1307 solves this issue. Normally, the user agent is
W3C-checklink/4.5 [4.154] libwww-perl/5.805

Kevin Keane
The NetTech
Find the Uncommon: Expert Solutions for a Network You Never Have to 
Think About

Office: 866-642-7116

This e-mail and attachments, if any, may contain confidential and/or 
proprietary information. Please be advised that the unauthorized use or 
disclosure of the information is strictly prohibited. The information 
herein is intended only for use by the intended recipient(s) named 
above. If you have received this transmission in error, please notify 
the sender immediately and permanently delete the e-mail and any copies, 
printouts or attachments thereof.
Received on Monday, 31 August 2009 09:24:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:59:14 UTC