- From: Ville Skytta via cvs-syncmail <cvsmail@w3.org>
- Date: Sat, 12 Dec 2009 20:06:39 +0000
- To: www-validator-cvs@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 UTC