validator/httpd/cgi-bin check,1.681,1.682

Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv6872/httpd/cgi-bin

Modified Files:
	check 
Log Message:
Add error document validation link to fatal error view (#7399).

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.681
retrieving revision 1.682
diff -u -d -r1.681 -r1.682
--- check	31 Aug 2009 21:17:39 -0000	1.681
+++ check	31 Aug 2009 21:30:03 -0000	1.682
@@ -1676,8 +1676,21 @@
     } else {
       $File->{'Error Flagged'} = TRUE;
 
+      my $no200url = undef;
+      if (!$File->{Opt}->{No200}) {
+        # $File->{URI} not set yet; setting it non-local has side effects
+        local $File->{URI}          = $uri->as_string;
+        local $File->{Opt}->{No200} = TRUE;
+        $no200url                   = &self_url_file($File);
+      }
+
       my $warning = $res->header("Client-Warning");
-      $warning = undef if ($warning && $warning =~ /Internal response/i);
+      if ($warning && $warning =~ /Internal response/i) {
+        # Response doc generated internally by LWP, no need to show that info
+        # nor to provide error doc validation link to it.
+        $warning  = undef;
+        $no200url = undef;
+      }
 
       $File->{Templates}->{Error}->param(fatal_http_error => TRUE);
       $File->{Templates}->{Error}->param(fatal_http_uri   => $uri->as_string);
@@ -1686,6 +1699,7 @@
       $File->{Templates}->{Error}->param(fatal_http_warn  => $warning);
       $File->{Templates}->{Error}->param(fatal_http_dns   => TRUE)
         if $res->code == 500;
+      $File->{Templates}->{Error}->param(fatal_http_no200 => $no200url);
     }
     return $File;
   }

Received on Monday, 31 August 2009 21:30:14 UTC