Where is the date in the response header set?

I want to know where the date will be set in the response. Given that the date is not a standard property of SeverletResponse.

And our server is nginx + tomcat , and inside tomcat it is spring .

I am viewing the org.apache.catalina.core file. ApplicationHttpResponse that implements javax.servlet.http. HttpServletResponse , but cannot find the result. there are some setXXX () methods, even setDateHeader (), with which spring can set the value to "Expires".

Or maybe the date will be set at the nginx level?

+4
source share
1 answer

I had the same questions as you, and found him.

See org.apache.coyote.http11.Http11Processor.java 1246: 1 (Org.apache.tomat.embed: cat-embed-core: 8.5.15)

// Add date header unless application has already set one (e.g. in a
// Caching Filter)
if (headers.getValue("Date") == null) {
    headers.addValue("Date").setString(FastHttpDateFormat.getCurrentDate());
}
0
source

All Articles