Skip to content

Commit 9523ba9

Browse files
authored
perf: HTTP node jsonBody support \n (labring#4070)
2 parents 0dccfd1 + 2f522af commit 9523ba9

File tree

1 file changed

+2
-1
lines changed
  • packages/service/core/workflow/dispatch/tools

1 file changed

+2
-1
lines changed

packages/service/core/workflow/dispatch/tools/http468.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
140140

141141
if (typeof val === 'string') {
142142
if (isQuoted) {
143-
return val.replace(/(?<!\\)"/g, '\\"');
143+
// Replace newlines with escaped newlines
144+
return val.replace(/\n/g, '\\n').replace(/(?<!\\)"/g, '\\"');
144145
}
145146
try {
146147
JSON.parse(val);

0 commit comments

Comments
 (0)