X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=tests%2FHTTPServer.pm;h=7f53535889dbbda391a903ff0dfe105beb990e62;hp=01c36957535268e6bc3e693786350f6fc518dd2b;hb=289ff1c86acbd60e09cb15d22df62b8e19942c3e;hpb=523c3dfcbc3e6858ea94288554d67d3c1208a7c1 diff --git a/tests/HTTPServer.pm b/tests/HTTPServer.pm index 01c36957..7f535358 100644 --- a/tests/HTTPServer.pm +++ b/tests/HTTPServer.pm @@ -1,8 +1,7 @@ -#!/usr/bin/perl -w - package HTTPServer; use strict; +use warnings; use HTTP::Daemon; use HTTP::Status; @@ -145,8 +144,7 @@ sub handle_auth { my $authhdr = $req->header('Authorization'); # Have we sent the challenge yet? - unless (defined $url_rec->{auth_challenged} - && $url_rec->{auth_challenged}) { + unless ($url_rec->{auth_challenged} || $url_rec->{auth_no_challenge}) { # Since we haven't challenged yet, we'd better not # have received authentication (for our testing purposes). if ($authhdr) { @@ -167,6 +165,9 @@ sub handle_auth { # failed it. $code = 400; $msg = "You didn't send auth after I sent challenge"; + if ($url_rec->{auth_no_challenge}) { + $msg = "--auth-no-challenge but no auth sent." + } } else { my ($sent_method) = ($authhdr =~ /^(\S+)/g); unless ($sent_method eq $url_rec->{'auth_method'}) {