aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2021-09-13 16:25:31 +0300
committerSergey Kandaurov <pluknet@nginx.com>2021-09-13 16:25:31 +0300
commit12cf623bc2f77ffd0a0425c8f1d07cf912160ef6 (patch)
treef147b81e1df395065b9885b7666be5f93a0d713e /src
parentee5d9279288beec74e563c5fd3e1d8dd0171fb70 (diff)
downloadnginx-12cf623bc2f77ffd0a0425c8f1d07cf912160ef6.tar.gz
nginx-12cf623bc2f77ffd0a0425c8f1d07cf912160ef6.zip
HTTP/3: Huffman encoding for the Last-Modified response field.
Diffstat (limited to 'src')
-rw-r--r--src/http/v3/ngx_http_v3_filter_module.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/http/v3/ngx_http_v3_filter_module.c b/src/http/v3/ngx_http_v3_filter_module.c
index 45063524b..0fcbed01f 100644
--- 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_request_t *r)
if (r->headers_out.last_modified == NULL
&& r->headers_out.last_modified_time != -1)
{
- 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);
+ n = sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1;
- b->last = ngx_http_time(b->last, r->headers_out.last_modified_time);
+ 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,
+ p, n);
}
if (host.data) {