@@ -106,15 +106,17 @@ function validateWebhookUrl(
106106 // check that hostname ends in "slack.com"
107107 if ( ! isValidSlackUrl ( webhook . url ) ) {
108108 const message = `Slack Webhook URL ${ webhook . url } does not have hostname that ends in 'slack.com'` ;
109- logger . warn ( {
110- webhook : {
111- id : webhook . _id . toString ( ) ,
112- name : webhook . name ,
113- url : webhook . url ,
114- body : webhook . body ,
109+ logger . warn (
110+ {
111+ webhook : {
112+ id : webhook . _id . toString ( ) ,
113+ name : webhook . name ,
114+ url : webhook . url ,
115+ body : webhook . body ,
116+ } ,
115117 } ,
116118 message ,
117- } ) ;
119+ ) ;
118120 throw new Error ( `SSRF AllowedDomainError: ${ message } ` ) ;
119121 }
120122 } else {
@@ -124,15 +126,17 @@ function validateWebhookUrl(
124126 const message = `Webhook attempting to query blacklisted route ${ blacklistedWebhookHosts . get (
125127 url . host ,
126128 ) } `;
127- logger . warn ( {
128- webhook : {
129- id : webhook . _id . toString ( ) ,
130- name : webhook . name ,
131- url : webhook . url ,
132- body : webhook . body ,
129+ logger . warn (
130+ {
131+ webhook : {
132+ id : webhook . _id . toString ( ) ,
133+ name : webhook . name ,
134+ url : webhook . url ,
135+ body : webhook . body ,
136+ } ,
133137 } ,
134138 message ,
135- } ) ;
139+ ) ;
136140 throw new Error ( `SSRF AllowedDomainError: ${ message } ` ) ;
137141 }
138142 }
@@ -200,10 +204,12 @@ export const handleSendGenericWebhook = async (
200204 title : escapeJsonString ( message . title ) ,
201205 } ) ;
202206 } catch ( e ) {
203- logger . error ( {
204- message : 'Failed to compile generic webhook body' ,
205- error : serializeError ( e ) ,
206- } ) ;
207+ logger . error (
208+ {
209+ error : serializeError ( e ) ,
210+ } ,
211+ 'Failed to compile generic webhook body' ,
212+ ) ;
207213 return ;
208214 }
209215
@@ -220,10 +226,12 @@ export const handleSendGenericWebhook = async (
220226 throw new Error ( errorText ) ;
221227 }
222228 } catch ( e ) {
223- logger . error ( {
224- message : 'Failed to send generic webhook message' ,
225- error : serializeError ( e ) ,
226- } ) ;
229+ logger . error (
230+ {
231+ error : serializeError ( e ) ,
232+ } ,
233+ 'Failed to send generic webhook message' ,
234+ ) ;
227235 }
228236} ;
229237
@@ -508,12 +516,14 @@ export const renderAlertTemplate = async ({
508516 2500 ,
509517 ) ;
510518 } catch ( e ) {
511- logger . error ( {
512- message : 'Failed to fetch sample logs' ,
513- savedSearchId : savedSearch . id ,
514- chartConfig,
515- error : serializeError ( e ) ,
516- } ) ;
519+ logger . error (
520+ {
521+ savedSearchId : savedSearch . id ,
522+ chartConfig,
523+ error : serializeError ( e ) ,
524+ } ,
525+ 'Failed to fetch sample logs' ,
526+ ) ;
517527 }
518528
519529 rawTemplateBody = `${ group ? `Group: "${ group } "` : '' }
0 commit comments