nileshrathi345 commented on code in PR #1143:
URL: https://github.com/apache/knox/pull/1143#discussion_r2763290175
##########
gateway-provider-rewrite/src/test/java/org/apache/knox/gateway/filter/rewrite/impl/UrlRewriteResponseTest.java:
##########
@@ -165,6 +165,33 @@ public void testStreamResponse() throws IOException {
testStreamResponse(content, rewriteResponse, "deflate");
}
+ @Test
+ public void testStreamEmptyGzipResponse() throws IOException {
Review Comment:
I can update the test to mock a valid MimeType (application/json), ensuring
UrlRewriteStreamFilterFactory returns a non-null filter, which can force the
execution into the modified block where the isGzip signature check now
correctly handles the 'header-present-but-body-not-gzipped' scenario?
Suggest for this approach please.
`UrlRewriteResponse rewriteResponse = new UrlRewriteResponse(config,
request, response) {
@Override
protected MimeType getMimeType() {
try {
return MimeTypes.create("application/json", null);
} catch (Exception e) {
return null;
}
}
};`
--
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]