@@ -38,6 +38,7 @@ export class WebhookController extends EventController implements EventControlle
3838 enabled : data . webhook ?. enabled ,
3939 events : data . webhook ?. events ,
4040 url : data . webhook ?. url ,
41+ headers : data . webhook ?. headers ,
4142 webhookBase64 : data . webhook . base64 ,
4243 webhookByEvents : data . webhook . byEvents ,
4344 } ,
@@ -46,6 +47,7 @@ export class WebhookController extends EventController implements EventControlle
4647 events : data . webhook ?. events ,
4748 instanceId : this . monitor . waInstances [ instanceName ] . instanceId ,
4849 url : data . webhook ?. url ,
50+ headers : data . webhook ?. headers ,
4951 webhookBase64 : data . webhook . base64 ,
5052 webhookByEvents : data . webhook . byEvents ,
5153 } ,
@@ -71,6 +73,7 @@ export class WebhookController extends EventController implements EventControlle
7173
7274 const webhookConfig = configService . get < Webhook > ( 'WEBHOOK' ) ;
7375 const webhookLocal = instance ?. events ;
76+ const webhookHeaders = instance ?. headers ;
7477 const we = event . replace ( / [ . - ] / gm, '_' ) . toUpperCase ( ) ;
7578 const transformedWe = we . replace ( / _ / gm, '-' ) . toLowerCase ( ) ;
7679 const enabledLog = configService . get < Log > ( 'LOG' ) . LEVEL . includes ( 'WEBHOOKS' ) ;
@@ -108,7 +111,10 @@ export class WebhookController extends EventController implements EventControlle
108111
109112 try {
110113 if ( instance ?. enabled && isURL ( instance . url , { require_tld : false } ) ) {
111- const httpService = axios . create ( { baseURL } ) ;
114+ const httpService = axios . create ( {
115+ baseURL,
116+ headers : webhookHeaders as Record < string , string > | undefined ,
117+ } ) ;
112118
113119 await httpService . post ( '' , webhookData ) ;
114120 }
0 commit comments