Commit 9523ba92 by Archer Committed by GitHub

perf: HTTP node jsonBody support \n (#4070)

parents 0dccfd17 2f522aff
...@@ -140,7 +140,8 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H ...@@ -140,7 +140,8 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
if (typeof val === 'string') { if (typeof val === 'string') {
if (isQuoted) { if (isQuoted) {
return val.replace(/(?<!\\)"/g, '\\"'); // Replace newlines with escaped newlines
return val.replace(/\n/g, '\\n').replace(/(?<!\\)"/g, '\\"');
} }
try { try {
JSON.parse(val); JSON.parse(val);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment