]> git.kaiwu.me - nginx.git/commitdiff
HTTP/3: do not emit a DATA frame header for header_only responses.
authorSergey Kandaurov <pluknet@nginx.com>
Thu, 25 Jun 2020 17:31:13 +0000 (20:31 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Thu, 25 Jun 2020 17:31:13 +0000 (20:31 +0300)
This resulted in the frame error due to the invalid DATA frame length.

src/http/v3/ngx_http_v3_request.c

index 7fb297728064676b0ed359c37447ed4593b5d10b..d9ea99d2ca3eabe77a59ee98c5d649711f126b31 100644 (file)
@@ -666,7 +666,7 @@ ngx_http_v3_create_header(ngx_http_request_t *r)
     hl->buf = b;
     hl->next = cl;
 
-    if (r->headers_out.content_length_n >= 0) {
+    if (r->headers_out.content_length_n >= 0 && !r->header_only) {
         len = 1 + ngx_http_v3_encode_varlen_int(NULL,
                                               r->headers_out.content_length_n);