I want to know at where the date in response is be set. Considering the date is not the standard property of SeverletResponse.
And our server are nginx+tomcat, and inside the tomcat, it is the spring framework.
I look into the org.apache.catalina.core.ApplicationHttpResponse which implements javax.servlet.http.HttpServletResponse, but cannot find the result. there are some sort of setXXX() methods, even setDateHeader(), by which spring can set "Expires" value.
And maybe the date is be set at nginx layer?
The Date property represents the value of a Date HTTP header on an HTTP response. The Date header is the date and time the message was sent.
The Date general HTTP header contains the date and time at which the message originated.
You can set response headers, you can add response headers. And you can wonder what the difference is. But think about it for a second, then do this exercise. Draw a line from the HttpResponse method to the method's behavior.
I had a same questions like you, and found it.
See org.apache.coyote.http11.Http11Processor.java 1246:1 (org.apache.tomat.embed:tomcat-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());
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With