Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7404

The GZIP feature should set Vary: Accept-Encoding always

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1.11
    • Fix Version/s: None
    • Component/s: Transports
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      At the moment, Accept-Encoding is added to the Vary header by
      GZIPOutInterceptor.GZipThresholdOutputStream only when the content is actually being compressed, while it should also be added to responses that could have been compressed if the client accepted gzip encoding - at least according to my reading of RFC 7231 (section 7.1.4):

      An origin server SHOULD send a Vary header field when its algorithm
      for selecting a representation varies based on aspects of the request
      message other than the method and request target,

      I think the main underlying reason for this is that, otherwise, a cache might get stuck serving a sub-optimal variant - in our case sending uncompressed data to clients that support gzip, as we're not telling it that a compressed variant is also available.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              edorfaus Frode Austvik
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: