mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ added back rawBody field
This commit is contained in:
parent
246213ba5d
commit
b3fe74a655
|
@ -275,14 +275,21 @@ export class Webhook implements INodeType {
|
||||||
default: 'data',
|
default: 'data',
|
||||||
description: 'Name of the property to return the data of instead of the whole JSON.',
|
description: 'Name of the property to return the data of instead of the whole JSON.',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Raw Body',
|
||||||
|
name: 'rawBody',
|
||||||
|
type: 'boolean',
|
||||||
|
default: false,
|
||||||
|
description: 'Raw body (binary)',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
async webhook(this: IWebhookFunctions): Promise<IWebhookResponseData> {
|
async webhook(this: IWebhookFunctions): Promise<IWebhookResponseData> {
|
||||||
const authentication = this.getNodeParameter('authentication', 0) as string;
|
const authentication = this.getNodeParameter('authentication', 0) as string;
|
||||||
|
const options = this.getNodeParameter('options', 0) as IDataObject;
|
||||||
const binaryData = this.getNodeParameter('binaryData', 0) as boolean;
|
const binaryData = this.getNodeParameter('binaryData', 0) as boolean;
|
||||||
const req = this.getRequestObject();
|
const req = this.getRequestObject();
|
||||||
const resp = this.getResponseObject();
|
const resp = this.getResponseObject();
|
||||||
|
@ -396,6 +403,16 @@ export class Webhook implements INodeType {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (options.rawBody) {
|
||||||
|
response.binary = {
|
||||||
|
data: {
|
||||||
|
// @ts-ignore
|
||||||
|
data: req.rawBody.toString('base64'),
|
||||||
|
mimeType,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
workflowData: [
|
workflowData: [
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in a new issue