dan-s1 commented on code in PR #8404:
URL: https://github.com/apache/nifi/pull/8404#discussion_r1490107134


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java:
##########
@@ -724,7 +726,7 @@ protected List<URI> getApplicationUrls() {
                     final String scheme = sslConnectionFactory == null ? 
HTTP_SCHEME : HTTPS_SCHEME;
                     final int port = serverConnector.getLocalPort();
                     final String connectorHost = serverConnector.getHost();
-                    final String host = 
StringUtils.defaultIfEmpty(connectorHost, HOST_UNSPECIFIED);
+                    final String host = 
URLEncoder.encode(StringUtils.defaultIfEmpty(connectorHost, HOST_UNSPECIFIED), 
StandardCharsets.UTF_8);
                     return URI.create(String.format(APPLICATION_URL_FORMAT, 
scheme, host, port));

Review Comment:
   Instead of using `URLEncoder` would using the seven argument constructor of 
`java.net.URI` be able to resolve to a URL?
   I was able to take the parts of the URL you listed in the ticket and 
instantiate the following in a unit test
   `URI uri = new URI("https", null, "0:0:0:0:0:0:0:1%lo", 8443, "/nifi", null, 
null);`
   which looks like 
   `https://[0:0:0:0:0:0:0:1%lo]:8443/nifi`
   
   I am just unsure how `%lo` gets resolved.



-- 
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: issues-unsubscr...@nifi.apache.org

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

Reply via email to