[
https://issues.apache.org/jira/browse/HTTPCORE-264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064599#comment-13064599
]
Oleg Kalnichevski commented on HTTPCORE-264:
--------------------------------------------
William
I see no problem with committing the patch but please do consider this before I
go ahead and apply the fix. Well-behaved proxies and gateways must remove all
hop-by-hop headers as defined in section 13.5.1 of the RFC 2616 [1].
Transfer-Encoding is defined as hop-by-hop. It must be removed by the proxy
along with other hop-by-hop headers prior to relaying the response to the HTTP
agent. Content-Length should be treated exactly the same way especially if the
proxy rewrites the enclosed entity. Essentially the existing behaviour provides
an additional level protection and ensures that HTTP messages are always
correctly delimited.
Oleg
[1] http://www.faqs.org/rfcs/rfc2616.html
> Allow Overwriting of Content-Length & Transfer-Encoding Headers
> ---------------------------------------------------------------
>
> Key: HTTPCORE-264
> URL: https://issues.apache.org/jira/browse/HTTPCORE-264
> Project: HttpComponents HttpCore
> Issue Type: Improvement
> Components: HttpCore
> Affects Versions: 4.1.2, 4.2-alpha1, 4.2, Future
> Environment: n/a
> Reporter: William R. Speirs
> Priority: Trivial
> Labels: patch
> Fix For: 4.1.2, 4.2, Future
>
> Attachments: ResponseContent.diff
>
>
> 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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]