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

ASF GitHub Bot commented on TS-4506:
------------------------------------

Github user bryancall commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/749#discussion_r69032683
  
    --- Diff: proxy/http/HttpTransact.cc ---
    @@ -8199,13 +8199,15 @@ HttpTransact::build_error_response(State *s, 
HTTPStatus status_code, const char
         if (has_ua_msie)
           s->hdr_info.client_response.value_set(MIME_FIELD_PROXY_CONNECTION, 
MIME_LEN_PROXY_CONNECTION, "close", 5);
       }
    -  // Add a bunch of headers to make sure that caches between
    -  // the Traffic Server and the client do not cache the error
    -  // page.
    +  // Make sure that caches between the Traffic Server and the client do 
not cache the error.
    +  // ToDo: Not sure this matches expectation in RFC 7223.
       s->hdr_info.client_response.value_set(MIME_FIELD_CACHE_CONTROL, 
MIME_LEN_CACHE_CONTROL, "no-store", 8);
    -  // Make sure there are no Expires and Last-Modified headers.
    -  s->hdr_info.client_response.field_delete(MIME_FIELD_EXPIRES, 
MIME_LEN_EXPIRES);
    -  s->hdr_info.client_response.field_delete(MIME_FIELD_LAST_MODIFIED, 
MIME_LEN_LAST_MODIFIED);
    +
    +  // Remove the Last-Modified header, but only if there is an ETag header. 
See sec 4.1 in
    +  //     https://tools.ietf.org/html/rfc7232#page-18
    --- End diff --
    
    I think it would be better to link to the section and not the page:
    https://tools.ietf.org/html/rfc7232#section-4.1


> Last-Modified and Expires headers are removed on 304 responses when they 
> shouldn't
> ----------------------------------------------------------------------------------
>
>                 Key: TS-4506
>                 URL: https://issues.apache.org/jira/browse/TS-4506
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: HTTP
>            Reporter: Leif Hedstrom
>            Assignee: Leif Hedstrom
>             Fix For: 7.0.0
>
>
> Right now, when ATS generates a 304 response (Not Modified), we always remove 
> the Last-Modified header. Reading the RFC, we should only remove the 
> Last-Modified header if there is an ETag header. This is a simple fix, and we 
> should just do it IMO.
> It also always removes the Expires headers, which we are not supposed to 
> touch. Now, we do overwrite the Cc: header, so maybe we should remove that 
> too ?
> From https://tools.ietf.org/html/rfc7232#page-18:
> {code}
>    The server generating a 304 response MUST generate any of the
>    following header fields that would have been sent in a 200 (OK)
>    response to the same request: Cache-Control, Content-Location, Date,
>    ETag, Expires, and Vary.
>    Since the goal of a 304 response is to minimize information transfer
>    when the recipient already has one or more cached representations, a
>    sender SHOULD NOT generate representation metadata other than the
>    above listed fields unless said metadata exists for the purpose of
>    guiding cache updates (e.g., Last-Modified might be useful if the
>    response does not have an ETag field).
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to