From 99a2647fd2840a00649a3a10f73baf3c54b35f7c Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Sat, 2 Jan 2016 22:18:13 +0100 Subject: [PATCH] Cmake URL tests: Better search for error 404, in received html snippet. --- development/checkurls/CheckURL.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/development/checkurls/CheckURL.pm b/development/checkurls/CheckURL.pm index 2601e954fa..b7d0e032d3 100755 --- a/development/checkurls/CheckURL.pm +++ b/development/checkurls/CheckURL.pm @@ -73,9 +73,14 @@ sub check_http_url($$$$) print " Read from \"$protocol://$host$getp\" "; return 3; } - if ($buf =~ /\Error 404\<\/title\>/) { - print " Page reports 'Error 404' from \"$protocol://$host$getp\" "; - return 3; + if ($buf =~ /\([^\<]*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; } -- 2.39.5