Skip to content

Commit

Permalink
Set message when building LegacyCustomWebhookMessage (#670)
Browse files Browse the repository at this point in the history
Signed-off-by: Petar Partlov <[email protected]>

Signed-off-by: Petar Partlov <[email protected]>
  • Loading branch information
petar-partlov authored Dec 1, 2022
1 parent 817d9ef commit 9d9f588
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ data class Destination(
}
DestinationType.CUSTOM_WEBHOOK -> {
destinationMessage = LegacyCustomWebhookMessage.Builder(name)
.withUrl(getLegacyCustomWebhookMessageURL(customWebhook))
.withUrl(getLegacyCustomWebhookMessageURL(customWebhook, compiledMessage))
.withHeaderParams(customWebhook?.headerParams)
.withMessage(compiledMessage).build()
}
Expand Down Expand Up @@ -296,14 +296,15 @@ data class Destination(
return content
}

private fun getLegacyCustomWebhookMessageURL(customWebhook: CustomWebhook?): String {
private fun getLegacyCustomWebhookMessageURL(customWebhook: CustomWebhook?, message: String): String {
return LegacyCustomWebhookMessage.Builder(name)
.withUrl(customWebhook?.url)
.withScheme(customWebhook?.scheme)
.withHost(customWebhook?.host)
.withPort(customWebhook?.port)
.withPath(customWebhook?.path)
.withQueryParams(customWebhook?.queryParams)
.withMessage(message)
.build().uri.toString()
}
}

0 comments on commit 9d9f588

Please sign in to comment.