# HG changeset patch # User Sergey Kandaurov # Date 1631539531 -10800 # Node ID 355461f0cc3b59b95d9017285ff30b149789b7e5 # Parent 2cb697e7d77fcc450a1e0cdf6c416b971ab41632 HTTP/3: Huffman encoding for the Last-Modified response field. diff --git a/src/http/v3/ngx_http_v3_filter_module.c b/src/http/v3/ngx_http_v3_filter_module.c --- a/src/http/v3/ngx_http_v3_filter_module.c +++ b/src/http/v3/ngx_http_v3_filter_module.c @@ -411,11 +411,18 @@ ngx_http_v3_header_filter(ngx_http_reque if (r->headers_out.last_modified == NULL && r->headers_out.last_modified_time != -1) { + n = sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1; + + p = ngx_pnalloc(r->pool, n); + if (p == NULL) { + return NGX_ERROR; + } + + ngx_http_time(p, r->headers_out.last_modified_time); + b->last = (u_char *) ngx_http_v3_encode_field_lri(b->last, 0, - NGX_HTTP_V3_HEADER_LAST_MODIFIED, NULL, - sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1); - - b->last = ngx_http_time(b->last, r->headers_out.last_modified_time); + NGX_HTTP_V3_HEADER_LAST_MODIFIED, + p, n); } if (host.data) {