You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/09/06 11:20:05 UTC

[GitHub] [dolphinscheduler] ruanwenjun commented on a diff in pull request #11750: [Bug]Alert plug-in: the get request in HTTP does not have a port

ruanwenjun commented on code in PR #11750:
URL: https://github.com/apache/dolphinscheduler/pull/11750#discussion_r963585950


##########
dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java:
##########
@@ -112,7 +112,8 @@ private void createHttpRequest(String msg) throws MalformedURLException, URISynt
             //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.getPort() == -1 ? unencodeUrl.getHost()

Review Comment:
   Can we directly use `new URL(url).toURI()` ?



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org