runtime icon indicating copy to clipboard operation
runtime copied to clipboard

[Replace]Different behavior of Replace with

Open Hooghof opened this issue 1 year ago • 4 comments

The value added in the 'Replace with' field are different processed in Camel 4 as in Camel 2. It concerns the values: \n, \r and \t. The expectation is that the value in the 'Replace with' field will replace the value in the 'Regex' field litterally. Looks like the 'Replace with' is interpreted as regex as well.

Test case Instance: acceptance and development Tenant: regression Tests Flow: ReplaceWith Tests in Postman: ReplaceWith CR /linefeed / tab or in cURL (use 'development' in stead of 'acceptance' for the development instance)

curl --location 'https://acceptance.dovetail.world/test/inbound_http/regressiontests/ReplaceWith?config=cr'
--header 'Content-Type: text/plain'
--data 'a,bCRc,dCRe,fCR'

curl --location 'https://acceptance.dovetail.world/test/inbound_http/regressiontests/ReplaceWith?config=linefeed'
--header 'Content-Type: text/plain'
--data 'a,bLNc,dLNe,fLN'

curl --location 'https://acceptance.dovetail.world/test/inbound_http/regressiontests/ReplaceWith?config=tab'
--header 'Content-Type: text/plain'
--data 'aTABb cTABd eTABf'

Hooghof avatar Oct 21 '24 11:10 Hooghof

If possible, could you provide text files with:

  1. Input
  2. Expected output
  3. Actual output

skin27 avatar Oct 28 '24 07:10 skin27

Attached examples for cr

skin27 avatar Oct 29 '24 07:10 skin27

Seems like we need to unescape the exceptional characters. This is a function from Camel. I added this so that it behaves like old way, but maybe in the future we can use a different approach.

skin27 avatar Oct 29 '24 08:10 skin27