Browse Source

[mod_expires,mod_webdav] fix truncated date string

(bug on master branch)
master
Glenn Strauss 2 weeks ago
parent
commit
a7b95c5b6a
  1. 6
      src/mod_expire.c
  2. 6
      src/mod_webdav.c

6
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,

6
src/mod_webdav.c

@ -3235,9 +3235,9 @@ webdav_propfind_live_props (const webdav_propfind_bufs * const restrict pb,
case WEBDAV_PROP_GETLASTMODIFIED:
buffer_append_string_len(b, CONST_STR_LEN(
"<D:getlastmodified ns0:dt=\"dateTime.rfc1123\">"));
buffer_commit(b,
http_date_time_to_str(buffer_extend(b, HTTP_DATE_SZ-1),
HTTP_DATE_SZ, pb->st.st_mtime));
if (!http_date_time_to_str(buffer_extend(b, HTTP_DATE_SZ-1),
HTTP_DATE_SZ, pb->st.st_mtime))
buffer_string_set_length(b, buffer_string_length(b)+1-HTTP_DATE_SZ);
buffer_append_string_len(b, CONST_STR_LEN(
"</D:getlastmodified>"));
if (pnum != WEBDAV_PROP_ALL) return 0;/* found *//*(else fall through)*/

Loading…
Cancel
Save