Cmake URL tests: Better search for error 404, in received html snippet.

This commit is contained in:
Kornel Benko 2016-01-02 22:18:13 +01:00
parent 4b49a59e71
commit 99a2647fd2

View File

@ -73,9 +73,14 @@ sub check_http_url($$$$)
print " Read from \"$protocol://$host$getp\" ";
return 3;
}
if ($buf =~ /\<title\>Error 404\<\/title\>/) {
print " Page reports 'Error 404' from \"$protocol://$host$getp\" ";
return 3;
if ($buf =~ /\<title\>([^\<]*404[^\<]*)\<\/title\>/i) {
my $title = $1;
$title =~ s/\n/ /g;
print "title = \"$title\"\n";
if ($title =~ /Error 404|404 Not Found/) {
print " Page reports 'Error 404' from \"$protocol://$host$getp\" ";
return 3;
}
}
return 0;
}