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]>
(cherry picked from commit 9d9f588)
  • Loading branch information
petar-partlov authored and github-actions[bot] committed Dec 1, 2022
1 parent 5477b50 commit 8bc2bbf
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 8bc2bbf

Please sign in to comment.