diff options
author | Michael Adam <obnox@samba.org> | 2009-09-14 13:28:56 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2009-09-14 13:30:57 +0200 |
commit | 8c5391ab6e1d1c31da011f5494ce79fc3072186e (patch) | |
tree | 9a55fa90c02495743ed9e5bc3dd9481ac798ce17 /tests | |
parent | 78502e4565e90a835ce81a0e6eb996f1a0b76615 (diff) | |
download | tinyproxy-8c5391ab6e1d1c31da011f5494ce79fc3072186e.tar.gz tinyproxy-8c5391ab6e1d1c31da011f5494ce79fc3072186e.zip |
tests:webserver: add handing of bad request error.
Michael
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/scripts/webserver.pl | 13 |
1 files changed, 13 insertions, 0 deletions
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 "<html>$EOL"; + print $client "<h1>400 Bad Request</h1>$EOL"; + print $client "<p>Error: " . $request->{error} . "</p>$EOL"; + print $client "</html>$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"; |