cherry-pick [Alert] [HTTP Plugin] Lose HTTP port

#14341
This commit is contained in:
旺阳 2023-06-14 17:38:58 +08:00 committed by zhuangchong
parent a147c6979b
commit 64e81c0e83
1 changed files with 6 additions and 1 deletions

View File

@ -113,7 +113,8 @@ public final class HttpSender {
//GET request add param in url
setMsgInUrl(msg);
URL unencodeUrl = new URL(url);
URI uri = new URI(unencodeUrl.getProtocol(), unencodeUrl.getHost(), unencodeUrl.getPath(), unencodeUrl.getQuery(), null);
URI uri = new URI(unencodeUrl.getProtocol(), unencodeUrl.getAuthority(), unencodeUrl.getPath(),
unencodeUrl.getQuery(), null);
httpRequest = new HttpGet(uri);
setHeader();
@ -164,4 +165,8 @@ public final class HttpSender {
logger.error("send http alert msg exception : {}", e.getMessage());
}
}
public String getRequestUrl() {
return httpRequest.getURI().toString();
}
}