mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(stepfunctions): decode escaped double-quoted literals (#9397)
The intrinsic argument splitter keeps an escaped double quote inside a double-quoted argument, but resolving the argument returned the backslash with it, so States.Array("a\"b,c", 'x') gave a first element of a\"b,c. A double-quoted argument now decodes \" and \\, and leaves any other backslash sequence as written, as a single-quoted one does with AWS's reserved escapes.
This commit is contained in:
1 parent
deb3865f32
commit
a8d1208bc8
2 files changed
+18
-4
No files matched your search
+12
@@ -52,6 +52,18 @@ class AslExecutorIntrinsicEscapesTest {
|
||||
assertEquals("x", result.get(2).asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
void escapedDoubleQuoteStaysInsideDoubleQuotedArgument() {
|
||||
JsonNode result = executor.resolvePath("States.Array(\"a\\\"b,c\", \"C:\\\\\", \"a\\q\", 'x')",
|
||||
mapper.createObjectNode());
|
||||
|
||||
assertEquals(4, result.size());
|
||||
assertEquals("a\"b,c", result.get(0).asText());
|
||||
assertEquals("C:\\", result.get(1).asText());
|
||||
assertEquals("a\\q", result.get(2).asText());
|
||||
assertEquals("x", result.get(3).asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
void pathValuesAreNotDecodedAsIntrinsicLiterals() throws Exception {
|
||||
JsonNode input = mapper.readTree("{\"value\":\"\\\\{\\\\}\\\\'\"}");
|
||||
|
||||
Reference in new issue
Block a user