if (last_modified_date != APR_DATE_BAD) {
ap_update_mtime(r, last_modified_date);
ap_set_last_modified(r);
+ if (APLOGrtrace1(r)) {
+ const char* datestr = apr_table_get(r->headers_out,
+ "Last-Modified");
+ apr_time_t timestamp = apr_date_parse_http(datestr);
+ if (timestamp < last_modified_date) {
+ char *last_modified_datestr = apr_palloc(r->pool,
+ APR_RFC822_DATE_LEN);
+ apr_rfc822_date(last_modified_datestr, last_modified_date);
+ ap_log_rerror(SCRIPT_LOG_MARK, APLOG_TRACE1, 0, r,
+ "The Last-Modified header value '%s' "
+ "(parsed as RFC882/RFC1123 datetime, "
+ "that assumes the GMT timezone) "
+ "has been replaced with: '%s'. "
+ "An origin server with a clock must not send "
+ "a Last-Modified date that is later than the "
+ "server's time of message origination.",
+ last_modified_datestr, datestr);
+ }
+ }
}
else {
if (APLOGrtrace1(r))