You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2015/09/17 17:54:04 UTC

[jira] [Commented] (TS-3912) 200 OK returned on successful conditional request if Last-Modified header not present in stored response

    [ https://issues.apache.org/jira/browse/TS-3912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14803121#comment-14803121 ] 

ASF subversion and git services commented on TS-3912:
-----------------------------------------------------

Commit c3e2b466b90e2568cf3a338a278cedfe731d766e in trafficserver's branch refs/heads/master from [~psudaemon]
[ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=c3e2b46 ]

TS-3912: Fix Coverity CID 1324531


> 200 OK returned on successful conditional request if Last-Modified header not present in stored response
> --------------------------------------------------------------------------------------------------------
>
>                 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)