[ 
https://issues.apache.org/jira/browse/KNOX-3248?focusedWorklogId=1003426&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1003426
 ]

ASF GitHub Bot logged work on KNOX-3248:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Feb/26 10:27
            Start Date: 04/Feb/26 10:27
    Worklog Time Spent: 10m 
      Work Description: 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;
               }
           }
       };`





Issue Time Tracking
-------------------

    Worklog Id:     (was: 1003426)
    Time Spent: 1h 10m  (was: 1h)

> Knox Gateway + Livy HA mode gzip exception results in duplicated requests and 
> unneeded failovers
> ------------------------------------------------------------------------------------------------
>
>                 Key: KNOX-3248
>                 URL: https://issues.apache.org/jira/browse/KNOX-3248
>             Project: Apache Knox
>          Issue Type: Improvement
>    Affects Versions: 2.0.0
>            Reporter: Nilesh Rathi
>            Priority: Major
>             Fix For: 2.1.0
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> While using Apache Knox as a gateway for Livy in a High Availability (HA) 
> environment, a race condition/logic error occurs in the rewrite provider when 
> Knox receives a 307 Temporary Redirect from a standby node.
> throws:{{{}{}}}
> {code:java}
> IOException: Input is not in the .gz format{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to