mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-03 03:59:12 +00:00
Webhook post fails due to empty secretKey (#5203)
This commit is contained in:
parent
f8751f3bb0
commit
994a83bb95
@ -210,7 +210,7 @@ public class WebhookRepository extends EntityRepository<Webhook> {
|
|||||||
try {
|
try {
|
||||||
String json = JsonUtils.pojoToJson(list);
|
String json = JsonUtils.pojoToJson(list);
|
||||||
Response response;
|
Response response;
|
||||||
if (webhook.getSecretKey() != null) {
|
if (webhook.getSecretKey() != null && !webhook.getSecretKey().isEmpty()) {
|
||||||
String hmac = "sha256=" + CommonUtil.calculateHMAC(webhook.getSecretKey(), json);
|
String hmac = "sha256=" + CommonUtil.calculateHMAC(webhook.getSecretKey(), json);
|
||||||
response = getTarget().header(RestUtil.SIGNATURE_HEADER, hmac).post(javax.ws.rs.client.Entity.json(json));
|
response = getTarget().header(RestUtil.SIGNATURE_HEADER, hmac).post(javax.ws.rs.client.Entity.json(json));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user