You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "Kevin Risden (Jira)" <ji...@apache.org> on 2019/11/07 15:18:00 UTC
[jira] [Commented] (KNOX-2102) Issue with Content-Length Header
when rewriting response body
[ https://issues.apache.org/jira/browse/KNOX-2102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16969341#comment-16969341 ]
Kevin Risden commented on KNOX-2102:
------------------------------------
I would tread very carefully here. Content length is used in the HTTP spec in a few places as far as I remember. Excluding the header I think can break different types of transfers.
This seems like a big bandaid instead of fixing the root cause which is making sure the content length from Knox is correct.
> Issue with Content-Length Header when rewriting response body
> -------------------------------------------------------------
>
> Key: KNOX-2102
> URL: https://issues.apache.org/jira/browse/KNOX-2102
> Project: Apache Knox
> Issue Type: Bug
> Reporter: In Park
> Priority: Minor
>
> Content-Length value is preserved although response body is rewritten by KNOX. This causes a content length mismatch error.
> DefaultDispatch.copyResponseHeaderFields() copies the Content-Length header from the original response regardless of whether rewrite happens or not.
> *workaround*: This can be worked around by configuring the dispatch to exclude this header.
> {code:java}
> <dispatch classname="org.apache.knox.gateway.dispatch.ConfigurableDispatch">
> <param>
> <name>responseExcludeHeaders</name>
> <value>CONTENT-LENGTH</value>
> </param>
> </dispatch>
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)