Uploaded image for project: 'HttpComponents HttpCore'
  1. HttpComponents HttpCore
  2. HTTPCORE-264

Allow Overwriting of Content-Length & Transfer-Encoding Headers

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 4.1.2, 4.2-alpha1, 4.2, Future
    • 4.2-alpha1
    • HttpCore
    • n/a

    Description

      Currently the ResponseContent interceptor will throw an exception if the Content-Length or Transfer-Encoding headers are found in the response. I am proposing a patch which adds 2 new constructors to ResponseContent. These new constructors allow ResponseContent to overwrite the Content-Length and/or Transfer-Encoding headers if they're already found instead of throwing an exception.

      The biggest use I see for this is in a reverse proxy. The response from the proxied server will already have proper Content-Length and Transfer-Encoding headers. However, this interceptor throws an exception in this case. The simple answer is to remove this interceptor; however, I would like to clean-up any response where these headers might be missing.

      The default constructor is to thrown an exception if these headers are found.

      Attachments

        1. ResponseContent.diff
          4 kB
          Bill Speirs
        2. TestStandardInterceptors.diff
          2 kB
          Bill Speirs

        Activity

          People

            Unassigned Unassigned
            wspeirs Bill Speirs
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: