mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-06-09 08:42:17 -04:00
Redirection error if other headers beginning with L (Aravind Gottipati - 1562572)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1502 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
parent
d15721d2f8
commit
58ea98cc81
3 changed files with 8 additions and 4 deletions
|
|
@ -193,3 +193,4 @@ Mike Emigh
|
|||
Christian Mies
|
||||
Andreas Behal
|
||||
O'Shaughnessy Evans
|
||||
Aravind Gottipati
|
||||
|
|
|
|||
|
|
@ -1094,9 +1094,8 @@ redir (char *pos, char *status_line)
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ use strict;
|
|||
use Test::More;
|
||||
use NPTest;
|
||||
|
||||
plan tests => 21;
|
||||
plan tests => 22;
|
||||
|
||||
my $successOutput = '/OK.*HTTP.*second/';
|
||||
|
||||
|
|
@ -95,3 +95,7 @@ like ( $res->output, "/pattern found/", "Error message says 'pattern found'");
|
|||
|
||||
$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");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue