bonampak commented on code in PR #1498:
URL: https://github.com/apache/knox/pull/1498#discussion_r4516349028
##########
gateway-provider-rewrite/src/test/java/org/apache/knox/gateway/filter/rewrite/api/UrlRewriteServletFilterTest.java:
##########
@@ -793,6 +793,46 @@ public void testResponseHtmlBodyRewriteCSSImport() throws
Exception {
assertThat(content, anyOf( is(responseHtmlOne), is(responseHtmlTwo)));
}
+ /*
+ * The Content-Length of the backend response must not be used for the
rewritten body, whatever the case of the
Review Comment:
Can be shorter or longer. (usually longer, as the frontend url is longer
than the original backend url). UrlRewriteResponse has always dropped the
backend Content-Length for this reason.
The problem was that the check was case-sensitive, it only matched
Content-Length.
A backend sending content-length got past it and the client received a
truncated body.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]