/*
 * Sets the Last-Modified entity header field, if it has not
 * already been set and if the value is meaningful.  Called before
 * DoGet, to ensure that headers are set before response data is
 * written. A subclass might have set this header already, so we
 * check.
 */
static void MaybeSetLastModified(HttpServletResponse& resp,
                                 long long lastModified)
{
  if (resp.ContainsHeader(HEADER_LASTMOD))
    return;
  if (lastModified >= 0)
    resp.SetDateHeader(HEADER_LASTMOD, lastModified);
}