mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(HTTP Request Node): Respect the original encoding of the incoming response (#9869)
This commit is contained in:
committed by
GitHub
parent
e84ab35c4a
commit
2d19aef540
@@ -1945,9 +1945,7 @@ export class HttpRequestV3 implements INodeType {
|
||||
false,
|
||||
) as boolean;
|
||||
|
||||
const data = await this.helpers
|
||||
.binaryToBuffer(response.body as Buffer | Readable)
|
||||
.then((body) => body.toString());
|
||||
const data = await this.helpers.binaryToString(response.body as Buffer | Readable);
|
||||
response.body = jsonParse(data, {
|
||||
...(neverError
|
||||
? { fallbackValue: {} }
|
||||
@@ -1959,9 +1957,7 @@ export class HttpRequestV3 implements INodeType {
|
||||
} else {
|
||||
responseFormat = 'text';
|
||||
if (!response.__bodyResolved) {
|
||||
const data = await this.helpers
|
||||
.binaryToBuffer(response.body as Buffer | Readable)
|
||||
.then((body) => body.toString());
|
||||
const data = await this.helpers.binaryToString(response.body as Buffer | Readable);
|
||||
response.body = !data ? undefined : data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user