From 8c5391ab6e1d1c31da011f5494ce79fc3072186e Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 14 Sep 2009 13:28:56 +0200 Subject: tests:webserver: add handing of bad request error. Michael --- tests/scripts/webserver.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/scripts') diff --git a/tests/scripts/webserver.pl b/tests/scripts/webserver.pl index 8358c4c..704a91d 100755 --- a/tests/scripts/webserver.pl +++ b/tests/scripts/webserver.pl @@ -178,6 +178,19 @@ sub child_action($) { my $request = parse_request($client); + if ($request->{error}) { + print $client "HTTP/1.0 400 Bad Request$EOL"; + print $client "Server: Tinyproxy-Test-Web-Server/$VERSION$EOL"; + print $client "Content-Type: text/html$EOL"; + print $client "$EOL"; + print $client "$EOL"; + print $client "

400 Bad Request

$EOL"; + print $client "

Error: " . $request->{error} . "

$EOL"; + print $client "$EOL"; + close $client; + return; + } + print $client "HTTP/1.0 200 OK$EOL"; print $client "Server: Tinyproxy-Test-Web-Server/$VERSION$EOL"; print $client "Content-Type: text/html$EOL"; -- cgit v1.2.3