diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2021-04-24 04:25:20 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2021-04-24 04:26:07 -0400 |
commit | a7b95c5b6aae3547ec740867296ca114e8f844e5 (patch) | |
tree | f916b4706483091c769223c9f30f29ed36a14e4c /src/mod_expire.c | |
parent | 81d18a8e359685c169cfd30e6a1574b98aedbaeb (diff) | |
download | lighttpd-git-a7b95c5b6aae3547ec740867296ca114e8f844e5.tar.gz |
[mod_expires,mod_webdav] fix truncated date string
(bug on master branch)
Diffstat (limited to 'src/mod_expire.c')
-rw-r--r-- | src/mod_expire.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mod_expire.c b/src/mod_expire.c index 3ca2db01..ee6281b0 100644 --- a/src/mod_expire.c +++ b/src/mod_expire.c @@ -317,9 +317,9 @@ REQUEST_FUNC(mod_expire_handler) { /* HTTP/1.0 */ vb = http_header_response_set_ptr(r, HTTP_HEADER_EXPIRES, CONST_STR_LEN("Expires")); - buffer_commit(vb, - http_date_time_to_str(buffer_extend(vb, HTTP_DATE_SZ-1), - HTTP_DATE_SZ, expires)); + if (!http_date_time_to_str(buffer_extend(vb, HTTP_DATE_SZ-1), + HTTP_DATE_SZ, expires)) + buffer_string_set_length(vb, buffer_string_length(vb)+1-HTTP_DATE_SZ); /* HTTP/1.1 */ vb = http_header_response_set_ptr(r, HTTP_HEADER_CACHE_CONTROL, |