perf: HTTP node jsonBody support \n (#4070)
Some checks are pending
Build FastGPT images in Personal warehouse / build-fastgpt-images (push) Waiting to run

This commit is contained in:
Archer 2025-03-10 13:56:34 +08:00 committed by GitHub
commit 9523ba92f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -140,7 +140,8 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
if (typeof val === 'string') {
if (isQuoted) {
return val.replace(/(?<!\\)"/g, '\\"');
// Replace newlines with escaped newlines
return val.replace(/\n/g, '\\n').replace(/(?<!\\)"/g, '\\"');
}
try {
JSON.parse(val);