return NGX_ERROR;
}
- if (hp->content_length_n
- > (off_t) http->max_response_body_size)
+ if (!http->header_only
+ && hp->content_length_n
+ > (off_t) http->max_response_body_size)
{
ngx_js_http_error(http, 0,
"fetch content length is too large");
listen 127.0.0.1:8080;
server_name localhost;
+ js_fetch_max_response_buffer_size 128k;
+
location /njs {
js_content test.njs;
}
host_header, multi, loc, property};
EOF
-$t->try_run('no njs.fetch')->plan(35);
+$t->try_run('no njs.fetch')->plan(36);
$t->run_daemon(\&http_daemon, port(8082));
$t->waitforsocket('127.0.0.1:' . port(8082));
'fetch host header');
}
+TODO: {
+local $TODO = 'not yet' unless has_version('0.8.2');
+
+like(http_get('/body_special?loc=head/large&method=HEAD'),
+ qr/200 OK.*<empty>$/s, 'fetch head method large content-length');
+}
+
###############################################################################
sub has_version {
"Connection: close" . CRLF .
CRLF;
+ } elsif ($uri eq '/head/large') {
+ print $client
+ "HTTP/1.1 200 OK" . CRLF .
+ "Content-Length: 1000000" . CRLF .
+ "Connection: close" . CRLF .
+ CRLF;
+
} elsif ($uri eq '/parted') {
print $client
"HTTP/1.1 200 OK" . CRLF .