# HG changeset patch # User Valentin Bartenev # Date 1481365418 -10800 # Node ID e02f1977846b18fadc3e30e2ca97d35eb788cbf9 # Parent 3834951e32ab92ce0ec9a35cb45f52742f5e8f28 HTTP/2: prevented creating temp files for requests without body. The problem was introduced by 52bd8cc17f34. diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c --- a/src/http/v2/ngx_http_v2.c +++ b/src/http/v2/ngx_http_v2.c @@ -3552,8 +3552,10 @@ ngx_http_v2_read_request_body(ngx_http_r rb->buf = ngx_create_temp_buf(r->pool, (size_t) len); } else { - /* enforce writing body to file */ - r->request_body_in_file_only = 1; + if (stream->preread) { + /* enforce writing preread buffer to file */ + r->request_body_in_file_only = 1; + } rb->buf = ngx_calloc_buf(r->pool);