mengnankkkk commented on code in PR #3779:
URL: https://github.com/apache/hertzbeat/pull/3779#discussion_r2363376309
##########
hertzbeat-alerter/src/main/java/org/apache/hertzbeat/alert/notice/impl/WebHookAlertNotifyHandlerImpl.java:
##########
@@ -39,18 +39,35 @@ final class WebHookAlertNotifyHandlerImpl extends
AbstractAlertNotifyHandlerImpl
@Override
public void send(NoticeReceiver receiver, NoticeTemplate noticeTemplate,
GroupAlert alert) {
try {
+ String hookUrl = receiver.getHookUrl();
+
+ // Validate URL completeness and add debug logging
+ if (hookUrl == null || hookUrl.trim().isEmpty()) {
+ throw new AlertNoticeException("Webhook URL is null or empty");
+ }
+
+ // Check if URL is truncated (missing required query parameters)
+ if (hookUrl.contains("logic.azure.cn") &&
!hookUrl.contains("sig=")) {
Review Comment:
That's a great point,. Thank you for the detailed feedback.
I agree completely that hard-coding "logic.azure.cn" is the wrong approach
and just treats the symptom, not the cause. This was intended as a temporary
patch to verify the issue.
I'll work on a proper solution tomorrow by investigating the root cause
upstream and will remove this check. I'll update the PR once I have a better
solution.
Thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]