[ 
https://issues.apache.org/jira/browse/NIFI-5278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16506198#comment-16506198
 ] 

ASF GitHub Bot commented on NIFI-5278:
--------------------------------------

Github user mgaido91 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2768#discussion_r194106518
  
    --- Diff: 
nifi-nar-bundles/nifi-spark-bundle/nifi-livy-processors/src/test/java/org/apache/nifi/processors/livy/ExecuteSparkInteractiveTestBase.java
 ---
    @@ -64,33 +66,37 @@ public void handle(String target, Request baseRequest, 
HttpServletRequest reques
                         }
                         session1Requests++;
                     }
    -
    -                response.setContentLength(responseBody.length());
    -
    -                try (PrintWriter writer = response.getWriter()) {
    -                    writer.print(responseBody);
    -                    writer.flush();
    -                }
    -
                 } else if ("POST".equalsIgnoreCase(request.getMethod())) {
    -
    -                String responseBody = "{}";
    -                response.setContentType("application/json");
    -
    -                if ("/sessions".equalsIgnoreCase(target)) {
    -                    responseBody = "{\"id\": 1, \"kind\": \"spark\", 
\"state\": \"idle\"}";
    -                } else if 
("/sessions/1/statements".equalsIgnoreCase(target)) {
    -                    responseBody = "{\"id\": 7}";
    +                String requestBody = IOUtils.toString(request.getReader());
    +                try {
    +                    System.out.println("requestBody: " + requestBody);
    --- End diff --
    
    I think this is a leftover from your tests and should be removed.


> ExecuteSparkInteractive processor fails on code containing a quote
> ------------------------------------------------------------------
>
>                 Key: NIFI-5278
>                 URL: https://issues.apache.org/jira/browse/NIFI-5278
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.6.0
>            Reporter: Peter Toth
>            Priority: Major
>
> ExecuteSparkInteractive usesĀ 
> org.apache.commons.lang.StringEscapeUtils.escapeJavaScript() which results 
> quotes to be escaped as \'. This breaks JSON payload of the Livy REST API.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to