mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
✨ Allow to set HTTP response code on Webhook-Node
This commit is contained in:
@@ -53,9 +53,13 @@ export function basicAuthAuthorizationError(resp: Response, realm: string, messa
|
||||
}
|
||||
|
||||
|
||||
export function sendSuccessResponse(res: Response, data: any, raw?: boolean) { // tslint:disable-line:no-any
|
||||
export function sendSuccessResponse(res: Response, data: any, raw?: boolean, responseCode?: number) { // tslint:disable-line:no-any
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
|
||||
if (responseCode !== undefined) {
|
||||
res.status(responseCode);
|
||||
}
|
||||
|
||||
if (raw === true) {
|
||||
res.send(JSON.stringify(data));
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user