[
https://issues.apache.org/jira/browse/TS-3912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Phil Sorber updated TS-3912:
----------------------------
Backport to Version: (was: 6.0.1, 5.3.3)
> 200 OK returned on successful conditional request if Last-Modified header not
> present in stored resposne
> --------------------------------------------------------------------------------------------------------
>
> Key: TS-3912
> URL: https://issues.apache.org/jira/browse/TS-3912
> Project: Traffic Server
> Issue Type: Bug
> Affects Versions: 5.3.2, 6.0.0
> Reporter: Phil Sorber
> Assignee: Phil Sorber
> Fix For: 6.1.0
>
>
> The [spec|https://tools.ietf.org/html/rfc7234#section-4.3.2] says:
> {noformat}
> A cache recipient SHOULD
> generate a 304 (Not Modified) response (using the metadata of the
> selected stored response) if one of the following cases is true: 1)
> the selected stored response has a Last-Modified field-value that is
> earlier than or equal to the conditional timestamp; 2) no
> Last-Modified field is present in the selected stored response, but
> it has a Date field-value that is earlier than or equal to the
> conditional timestamp; or, 3) neither Last-Modified nor Date is
> present in the selected stored response, but the cache recorded it as
> having been received at a time earlier than or equal to the
> conditional timestamp.
> {noformat}
> but our
> [code|https://github.com/apache/trafficserver/blob/master/proxy/http/HttpTransactCache.cc#L1297-L1313]
> does:
> {noformat}
> // If-Modified-Since //
> if (request->presence(MIME_PRESENCE_IF_MODIFIED_SINCE)) {
> // lm_value is zero if Last-modified not exists
> ink_time_t lm_value = response->get_last_modified();
> // we won't return NOT_MODIFIED if Last-modified not exists
> if ((lm_value == 0) || (request->get_if_modified_since() < lm_value)) {
> return response->status_get();
> } else {
> // we cannot return NOT_MODIFIED yet, need to check If-none-match
> response_code = HTTP_STATUS_NOT_MODIFIED;
> if (!request->presence(MIME_PRESENCE_IF_NONE_MATCH)) {
> return response_code;
> }
> }
> }
> {noformat}
> So we are ignoring Date header and response received time.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)