tests/webclient: return error when HTTP status > 399

This commit is contained in:
rofl0r 2020-09-13 00:33:16 +01:00
parent 4847d8cdb3
commit bfe59856b2

View File

@ -122,11 +122,16 @@ foreach my $document (@ARGV) {
print $remote $request;
$_ = <$remote>;
print; # /* HTTP/1.0 400 Bad Request */
my($errn) = ($_ =~ /HTTP\/\d\.\d (\d{3})/);
while (<$remote>) {
print;
}
close $remote;
exit($errn - 399) if($errn > 399);
}
exit(0);