Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-4506

Last-Modified and Expires headers are removed on 304 responses when they shouldn't

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Patch Available
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 7.1.0
    • Component/s: HTTP
    • Labels:
      None
    • Backport to Version:

      Description

      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:

         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).
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                zwoop Leif Hedstrom
                Reporter:
                zwoop Leif Hedstrom
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m