Skip to content

Commit 1c5a27d

Browse files
feat(Webhook Node): Add notices about using the 'Content-Type' header (#17739)
1 parent 724b5a5 commit 1c5a27d

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

packages/nodes-base/nodes/RespondToWebhook/RespondToWebhook.node.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ import {
2323
} from 'n8n-workflow';
2424
import type { Readable } from 'stream';
2525

26-
import { formatPrivateKey, generatePairedItemData } from '../../utils/utilities';
27-
import { configuredOutputs } from './utils/outputs';
2826
import { getBinaryResponse } from './utils/binary';
27+
import { configuredOutputs } from './utils/outputs';
28+
import { formatPrivateKey, generatePairedItemData } from '../../utils/utilities';
2929

3030
const respondWithProperty: INodeProperties = {
3131
displayName: 'Respond With',
@@ -252,7 +252,18 @@ export class RespondToWebhook implements INodeType {
252252
},
253253
description: 'The name of the node input field with the binary data',
254254
},
255-
255+
{
256+
displayName:
257+
'To avoid unexpected behavior, add a "Content-Type" response header with the appropriate value',
258+
name: 'contentTypeNotice',
259+
type: 'notice',
260+
default: '',
261+
displayOptions: {
262+
show: {
263+
respondWith: ['text'],
264+
},
265+
},
266+
},
256267
{
257268
displayName: 'Options',
258269
name: 'options',

packages/nodes-base/nodes/Webhook/Webhook.node.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,18 @@ export class Webhook extends Node {
175175
},
176176
responseDataProperty,
177177
responseBinaryPropertyNameProperty,
178+
{
179+
displayName:
180+
'If you are sending back a response, add a "Content-Type" response header with the appropriate value to avoid unexpected behavior',
181+
name: 'contentTypeNotice',
182+
type: 'notice',
183+
default: '',
184+
displayOptions: {
185+
show: {
186+
responseMode: ['onReceived'],
187+
},
188+
},
189+
},
178190

179191
{
180192
...optionsProperty,

0 commit comments

Comments
 (0)