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

validator/httpd/cgi-bin check,1.750,1.751

From: Ville Skytta via cvs-syncmail <cvsmail@w3.org>
Date: Sat, 12 Dec 2009 20:06:39 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1NJYEh-0004gp-1m@lionel-hutz.w3.org>
Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv18006/httpd/cgi-bin

Modified Files:
	check 
Log Message:
Don't bother with gzipping HTML5 validator traffic if it seems to be installed locally.

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.750
retrieving revision 1.751
diff -u -d -r1.750 -r1.751
--- check	12 Dec 2009 12:47:19 -0000	1.750
+++ check	12 Dec 2009 20:06:36 -0000	1.751
@@ -1213,8 +1213,15 @@
     # formatted string).
     $req->header('Last-Modified', $File->{Modified}) if $File->{Modified};
 
-    # If not in debug mode, gzip the request (LWP >= 5.817)
-    eval { $req->encode("gzip"); } unless $File->{Opt}->{Debug};
+    # Use gzip in non-debug, remote HTML5 validator mode (LWP >= 5.817).
+    if (!$File->{Opt}->{Debug} &&
+        $url->host() !~ /^(?:localhost|127(?:\.\d+){3}|.*\.localdomain)$/i)
+    {
+        eval { $req->encode("gzip"); };
+    }
+    else {
+        $req->header('Accept-Encoding', 'identity');
+    }
 
     my $res = $ua->request($req);
     if (!$res->is_success()) {
Received on Saturday, 12 December 2009 20:06:40 GMT

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