diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2021-04-03 12:43:46 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2021-04-05 13:24:51 -0400 |
commit | 325d89b99fb29492fd8dddbf28caa0cae0d78b64 (patch) | |
tree | 18d9fcf5fe22e59ae3167e0487cf6230063988f8 /src/mod_expire.c | |
parent | c41ebea4bb220c8fe252f472eec836c691734690 (diff) | |
download | lighttpd-git-325d89b99fb29492fd8dddbf28caa0cae0d78b64.tar.gz |
[multiple] more reuse of http_date_time_to_str()
Diffstat (limited to 'src/mod_expire.c')
-rw-r--r-- | src/mod_expire.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mod_expire.c b/src/mod_expire.c index a2f42eb8..3ca2db01 100644 --- a/src/mod_expire.c +++ b/src/mod_expire.c @@ -4,6 +4,7 @@ #include "array.h" #include "buffer.h" #include "log.h" +#include "http_date.h" #include "http_header.h" #include "plugin.h" @@ -313,12 +314,12 @@ REQUEST_FUNC(mod_expire_handler) { /* expires should be at least cur_ts */ if (expires < cur_ts) expires = cur_ts; - struct tm tm; - /* HTTP/1.0 */ vb = http_header_response_set_ptr(r, HTTP_HEADER_EXPIRES, CONST_STR_LEN("Expires")); - buffer_append_strftime(vb, "%a, %d %b %Y %T GMT", gmtime_r(&expires,&tm)); + buffer_commit(vb, + http_date_time_to_str(buffer_extend(vb, HTTP_DATE_SZ-1), + HTTP_DATE_SZ, expires)); /* HTTP/1.1 */ vb = http_header_response_set_ptr(r, HTTP_HEADER_CACHE_CONTROL, |