mirror of
https://github.com/nginx/nginx.git
synced 2025-07-27 07:36:19 +08:00
add_header last-modified ""
This commit is contained in:
parent
32717eb60c
commit
98b5a3b15b
@ -369,7 +369,14 @@ ngx_http_set_last_modified(ngx_http_request_t *r, ngx_http_header_val_t *hv,
|
|||||||
old = NULL;
|
old = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r->headers_out.last_modified_time = -1;
|
||||||
|
|
||||||
if (old == NULL || *old == NULL) {
|
if (old == NULL || *old == NULL) {
|
||||||
|
|
||||||
|
if (value->len == 0) {
|
||||||
|
return NGX_OK;
|
||||||
|
}
|
||||||
|
|
||||||
h = ngx_list_push(&r->headers_out.headers);
|
h = ngx_list_push(&r->headers_out.headers);
|
||||||
if (h == NULL) {
|
if (h == NULL) {
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
@ -377,14 +384,17 @@ ngx_http_set_last_modified(ngx_http_request_t *r, ngx_http_header_val_t *hv,
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
h = *old;
|
h = *old;
|
||||||
|
|
||||||
|
if (value->len == 0) {
|
||||||
|
h->hash = 0;
|
||||||
|
return NGX_OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
h->hash = hv->value.hash;
|
h->hash = hv->value.hash;
|
||||||
h->key = hv->value.key;
|
h->key = hv->value.key;
|
||||||
h->value = *value;
|
h->value = *value;
|
||||||
|
|
||||||
r->headers_out.last_modified_time = -1;
|
|
||||||
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user