diff options
author | Eric Wong <e@80x24.org> | 2016-03-06 02:09:20 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-03-06 02:10:24 +0000 |
commit | 90d7c7c49b6af90624cca042deb9af38a5e44a2f (patch) | |
tree | eddafbb842a13af8539c80c7e5cd84d0b4f36a4a /t/httpd-corner.t | |
parent | 2ea979f43ec87547b7dfb74312a21062044d018a (diff) | |
download | public-inbox-90d7c7c49b6af90624cca042deb9af38a5e44a2f.tar.gz |
HTTP::Parser::XS::PP does not reject excessively large headers like the XS version. Ensure we reject headers over 16K since public-inbox should never need such large request headers.
Diffstat (limited to 't/httpd-corner.t')
-rw-r--r-- | t/httpd-corner.t | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/t/httpd-corner.t b/t/httpd-corner.t index 833eb429..8670846c 100644 --- a/t/httpd-corner.t +++ b/t/httpd-corner.t @@ -84,6 +84,18 @@ my $spawn_httpd = sub { is($body, "hello world\n", 'callback body matches expected'); } +{ + my $conn = conn_for($sock, 'excessive header'); + $SIG{PIPE} = 'IGNORE'; + $conn->write("GET /callback HTTP/1.0\r\n"); + foreach my $i (1..500000) { + last unless $conn->write("X-xxxxxJunk-$i: omg\r\n"); + } + ok(!$conn->write("\r\n"), 'broken request'); + ok($conn->read(my $buf, 8192), 'read response'); + my ($head, $body) = split(/\r\n\r\n/, $buf); + like($head, qr/\b400\b/, 'got 400 response'); +} # Unix domain sockets { |