summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d15721d)
raw | patch | inline | side by side (parent: d15721d)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Thu, 19 Oct 2006 18:59:58 +0000 (18:59 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Thu, 19 Oct 2006 18:59:58 +0000 (18:59 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1502 f882894a-f735-0410-b71e-b25c423dba1c
THANKS.in | patch | blob | history | |
plugins/check_http.c | patch | blob | history | |
plugins/t/check_http.t | patch | blob | history |
diff --git a/THANKS.in b/THANKS.in
index 8bf650792bd6ae4bc0a23df08eeb6e4313bca13a..4ded0eea295b87af6484fef9a49c4efcb8435626 100644 (file)
--- a/THANKS.in
+++ b/THANKS.in
Christian Mies
Andreas Behal
O'Shaughnessy Evans
+Aravind Gottipati
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 6810f5c1686f6df3a0b287828213380a6bfba410..93a68ef13e4c26d0c235385b74a8d0ae446b15ed 100644 (file)
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
die (STATE_UNKNOWN, _("Could not allocate url\n"));
while (pos) {
-
- if (sscanf (pos, "%[Ll]%*[Oo]%*[Cc]%*[Aa]%*[Tt]%*[Ii]%*[Oo]%*[Nn]:%n", xx, &i) < 1) {
-
+ sscanf (pos, "%[Ll]%*[Oo]%*[Cc]%*[Aa]%*[Tt]%*[Ii]%*[Oo]%*[Nn]:%n", xx, &i);
+ if (i == 0) {
pos += (size_t) strcspn (pos, "\r\n");
pos += (size_t) strspn (pos, "\r\n");
if (strlen(pos) == 0)
diff --git a/plugins/t/check_http.t b/plugins/t/check_http.t
index 4e3c06cb73b1c14a756c4034de793a01a740e4a6..21ac0f7a0b78388ce6a9386551f0c0b1b6b97cdf 100644 (file)
--- a/plugins/t/check_http.t
+++ b/plugins/t/check_http.t
use Test::More;
use NPTest;
-plan tests => 21;
+plan tests => 22;
my $successOutput = '/OK.*HTTP.*second/';
$res = NPTest->testCmd( "./check_http -H altinity.com -r 'nAGiOs' --invert-regex" );
cmp_ok( $res->return_code, "==", 0, "And also when not found");
+
+$res = NPTest->testCmd( "./check_http -H www.worldfirefoxday.com -f follow" );
+is( $res->return_code, 0, "Redirection based on location is okay");
+