Skip to content

Commit

Permalink
Merge pull request #85 from devtron-labs/template-escape-fix
Browse files Browse the repository at this point in the history
fix: Mustache.escape fix
  • Loading branch information
prakash100198 authored Oct 9, 2024
2 parents bc18175 + 94b43e9 commit 133c887
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/destination/destinationHandlers/sesHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ export class SESService implements Handler {
if(event.eventTypeId===4 || event.eventTypeId === EVENT_TYPE.ImagePromotion){
let commentDisplayStyle = (event.payload.imageComment === "") ? 'none' : 'inline';
let tagDisplayStyle = (event.payload.imageTagNames === null) ? 'none' : 'inline';
json = Mustache.render(Mustache.escape(template), { ...parsedEvent, commentDisplayStyle ,tagDisplayStyle});
json = Mustache.render(template, { ...parsedEvent, commentDisplayStyle ,tagDisplayStyle});
}else if(event.eventTypeId===5){
let commentDisplayStyle = (event.payload.protectConfigComment === "") ? 'none' : 'inline';
json = Mustache.render(Mustache.escape(template), { ...parsedEvent, commentDisplayStyle });
json = Mustache.render(template, { ...parsedEvent, commentDisplayStyle });
}
else{
json = Mustache.render(Mustache.escape(template), parsedEvent)
json = Mustache.render(template, parsedEvent)
}

const res = await sdk.send(
Expand Down
4 changes: 2 additions & 2 deletions src/destination/destinationHandlers/slackHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ export class SlackService implements Handler {
if (event.eventTypeId == EVENT_TYPE.ScoopNotification){
const date = moment(event.eventTime);
event.payload.scoopNotificationConfig.data.interceptedAt = date.unix();
jsons = Mustache.render(Mustache.escape(template), event.payload.scoopNotificationConfig.data);
jsons = Mustache.render(template, event.payload.scoopNotificationConfig.data);
}else{
let parsedEvent = this.mh.parseEvent(event as Event, true);
jsons = Mustache.render(Mustache.escape(template), parsedEvent);
jsons = Mustache.render(template, parsedEvent);
}

let j = JSON.parse(jsons)
Expand Down
6 changes: 3 additions & 3 deletions src/destination/destinationHandlers/smtpHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ export class SMTPService implements Handler {
if(event.eventTypeId===4){
let commentDisplayStyle = (event.payload.imageComment === "") ? 'none' : 'inline';
let tagDisplayStyle = (event.payload.imageTagNames === null) ? 'none' : 'inline';
json = Mustache.render(Mustache.escape(template), { ...parsedEvent, commentDisplayStyle ,tagDisplayStyle});
json = Mustache.render(template, { ...parsedEvent, commentDisplayStyle ,tagDisplayStyle});
}else if(event.eventTypeId===5){
let commentDisplayStyle = (event.payload.protectConfigComment === "") ? 'none' : 'inline';
json = Mustache.render(Mustache.escape(template), { ...parsedEvent, commentDisplayStyle });
json = Mustache.render(template, { ...parsedEvent, commentDisplayStyle });
}else{
json = Mustache.render(Mustache.escape(template), parsedEvent)
json = Mustache.render(template, parsedEvent)
}
const res = await sdk.send(
{
Expand Down
4 changes: 2 additions & 2 deletions src/destination/destinationHandlers/webhookHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ export class WebhookService implements Handler{
if (event.eventTypeId == EVENT_TYPE.ScoopNotification){
const date = moment(event.eventTime);
event.payload.scoopNotificationConfig.data.interceptedAt = date.unix();
jsons = Mustache.render(Mustache.escape(template), event.payload.scoopNotificationConfig.data);
jsons = Mustache.render(template, event.payload.scoopNotificationConfig.data);
}else {
let parsedEvent = this.mh.parseEventForWebhook(event as Event);
jsons = Mustache.render(Mustache.escape(template), parsedEvent);
jsons = Mustache.render(template, parsedEvent);
}

let j = JSON.parse(jsons);
Expand Down

0 comments on commit 133c887

Please sign in to comment.