[
https://issues.apache.org/jira/browse/NIFI-10754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17655168#comment-17655168
]
ASF subversion and git services commented on NIFI-10754:
--------------------------------------------------------
Commit 3a6001387681f79615ac5ce776e74548dd825005 in nifi's branch
refs/heads/main from dan-s1
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=3a60013876 ]
NIFI-10754 Added getUri NIFI Expression Language function
This closes #6689
Signed-off-by: David Handermann <[email protected]>
> Nifi Expression Language method urlEncode does not encode a URL path
> correctly when it contains white space
> -----------------------------------------------------------------------------------------------------------
>
> Key: NIFI-10754
> URL: https://issues.apache.org/jira/browse/NIFI-10754
> Project: Apache NiFi
> Issue Type: Bug
> Reporter: Daniel Stieglitz
> Assignee: Daniel Stieglitz
> Priority: Major
> Time Spent: 3h 10m
> Remaining Estimate: 0h
>
> The Nifi Expression Language urlEncode method replaces white space with a +
> and not %20. That is fine for the query section of a URL but not the path.
> There are many Stackoverflow posts which detail the issue. Here is one,
> [URLEncoder not able to translate space
> character|https://stackoverflow.com/questions/4737841/urlencoder-not-able-to-translate-space-character]
> Our particular scenario is where we build a URL from attributes and then try
> to call the URL with InvokeHTTP
> e.g. of a URL with a space in its path
> {code:java}
> https://somehost/api/v1/somepath
> /actual?att1=something&att2=somethingelse{code}
> from that URL we only encode the part which may have special characters
> {code:java}
> somepath /actual{code}
> urlEncode will convert that to
> {code:java}
> somepath+%2Factual{code}
> The + in the URL path is not the same as a blank space hence the call to
> InvokeHttp fails.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)