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

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

                Author: ASF GitHub Bot
            Created on: 03/Jan/24 03:06
            Start Date: 03/Jan/24 03:06
    Worklog Time Spent: 10m 
      Work Description: upczsh commented on code in PR #828:
URL: https://github.com/apache/knox/pull/828#discussion_r1440024716


##########
gateway-provider-rewrite/src/main/java/org/apache/knox/gateway/filter/rewrite/impl/json/JsonFilterReader.java:
##########
@@ -77,6 +77,11 @@ class JsonFilterReader extends Reader {
     bufferingLevel = null;
     bufferingConfig = null;
     this.config = config;
+    jsonParserConfigInit();
+  }
+
+  private void jsonParserConfigInit() {
+    
parser.enable(com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS);

Review Comment:
   @smolnar82 Thanks for your guidance, I have used 
JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS instead of the deprecated 
JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS.
   On the other hand, the reason for not adding it on line 69 is that this 
setting is the content of parse, and other json parse configurations may be 
enabled in the future, so I wrote a separate method.





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

    Worklog Id:     (was: 897743)
    Time Spent: 40m  (was: 0.5h)

> json contains NaN value parsing failed
> --------------------------------------
>
>                 Key: KNOX-2995
>                 URL: https://issues.apache.org/jira/browse/KNOX-2995
>             Project: Apache Knox
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 2.0.0, 1.6.0
>            Reporter: zhaoshuaihua
>            Priority: Major
>         Attachments: KNOX-2995.patch, screenshot-1.png, screenshot-2.png, 
> screenshot-3.png
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> If the proxy address returns JSON, which contains something similar to xxx: 
> NaN, then knox will fail to parse. Therefore, support for parsing NaN is 
> added.
> I click on the page with return json and the content of Resopnse is empty. 
> like this :  !screenshot-1.png!
>  
> Checking the gateway.log log shows the following error message.
> !screenshot-2.png!
> The display results after my repair are as follows: 
> !screenshot-3.png!
>  
>  



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

Reply via email to