tests:webserver: add handing of bad request error.

Michael
This commit is contained in:
Michael Adam committed 2009-09-14 13:30:57 +02:00
1 parent 78502e4565
commit 8c5391ab6e
1 file changed
+13
+13
View File
@@ -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";