You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/11/23 21:36:14 UTC

[GitHub] [nifi] exceptionfactory commented on a change in pull request #4683: NIFI-8029 Adding StringEscapeUtils.escapeJava() to correct value with…

exceptionfactory commented on a change in pull request #4683:
URL: https://github.com/apache/nifi/pull/4683#discussion_r529011729



##########
File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java
##########
@@ -1122,7 +1123,7 @@ public long contentLength() {
 
         final ComponentLog logger = getLogger();
         for (String headerKey : dynamicPropertyNames) {
-            String headerValue = context.getProperty(headerKey).evaluateAttributeExpressions(requestFlowFile).getValue();
+            String headerValue = StringEscapeUtils.escapeJava(context.getProperty(headerKey).evaluateAttributeExpressions(requestFlowFile).getValue());

Review comment:
       [RFC 2616 Section 2.2](https://tools.ietf.org/html/rfc2616#section-2.2) indicates that text values, used in HTTP headers, may contain characters other than ISO-8859-1 only when encoding according to [RFC 2047](https://tools.ietf.org/html/rfc2047).  Support for encoded values would depend on the receiving server implementation as @mattyb149 noted.  Implementing a solution inside the Expression Language context would provide greater flexibility for use cases where supporting characters outside of ISO-8859-1 in HTTP headers is required.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org