diff options
author | hugo <hugo@localhost> | 2000-07-12 19:14:31 +0000 |
---|---|---|
committer | hugo <hugo@localhost> | 2000-07-12 19:14:31 +0000 |
commit | 7b1a41f725366d51cf050011f0b82a4c3a780c83 (patch) | |
tree | 33bbd1ae08db27232f58683a16150c1fb4f5fe11 | |
parent | 0db4c38f704de6ecc9125b0dba0fff7f30f79f44 (diff) | |
download | markup-validator-7b1a41f725366d51cf050011f0b82a4c3a780c83.zip markup-validator-7b1a41f725366d51cf050011f0b82a4c3a780c83.tar.gz markup-validator-7b1a41f725366d51cf050011f0b82a4c3a780c83.tar.bz2 |
Now checks the Content-Encoding too
-rwxr-xr-x | httpd/cgi-bin/checklink.pl | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/httpd/cgi-bin/checklink.pl b/httpd/cgi-bin/checklink.pl index e153028..fa68b49 100755 --- a/httpd/cgi-bin/checklink.pl +++ b/httpd/cgi-bin/checklink.pl @@ -5,7 +5,7 @@ # (c) 1999-2000 World Wide Web Consortium # based on Renaud Bruyeron's checklink.pl # -# $Id: checklink.pl,v 2.55 2000-07-10 15:21:37 hugo Exp $ +# $Id: checklink.pl,v 2.56 2000-07-12 19:14:31 hugo Exp $ # # This program is licensed under the W3C(r) License: # http://www.w3.org/Consortium/Legal/copyright-software @@ -31,7 +31,7 @@ $| = 1; # Version info my $PROGRAM = 'W3C checklink'; -my $VERSION = q$Revision: 2.55 $ . '(c) 1999-2000 W3C'; +my $VERSION = q$Revision: 2.56 $ . '(c) 1999-2000 W3C'; my $REVISION; ($REVISION = $VERSION) =~ s/Revision: (\d+\.\d+) .*/$1/; # Different options specified by the user @@ -523,13 +523,21 @@ sub get_document() { $response->{absolute_uri} = $base_uri->abs($request_uri); # Parse the document - if (! ($response->header('Content-type') =~ m/text\/html/)) { + my $failed_reason; + if (! ($response->header('Content-Type') =~ m/text\/html/)) { + $failed_reason = "Content-Type is '". + $response->header('Content-Type')."'"; + } elsif ($response->header('Content-Encoding')) { + $failed_reason = "Content-Encoding is '". + $response->header('Content-encoding')."'"; + } + if ($failed_reason) { if (! $in_recursion) { if ($_html) { &html_header($uri); } - &hprintf("Can't check link: Content-type is '%s'.\n", - $response->header('Content-type')); + &hprintf("Can't check links: %s.\n", + $failed_reason); } $response->{Stop} = 1; } |