diff --git a/packages/nodes-base/nodes/Form/utils.ts b/packages/nodes-base/nodes/Form/utils.ts index 079ae4278c..35f06496ce 100644 --- a/packages/nodes-base/nodes/Form/utils.ts +++ b/packages/nodes-base/nodes/Form/utils.ts @@ -170,8 +170,8 @@ export async function formWebhook( } } catch (error) { if (error instanceof WebhookAuthorizationError) { - res.writeHead(error.responseCode, { 'WWW-Authenticate': 'Basic realm="Webhook"' }); - res.end(error.message); + res.setHeader('WWW-Authenticate', 'Basic realm="Enter credentials"'); + res.status(401).send(); return { noWebhookResponse: true }; } throw error;