Community
Participate
Working Groups
URLs of the form http://host:port/path%20with%20blanks are encoded as http://host:port/path%2520with%2520blanks which is wrong
* URLs entered for projects sometimes are "slightly" invalid, e.g. contain blanks in paths; browsers usually try to "sanitize" such URLs, and so should HostReachableValidator * encoding of URLs/URIs in Java is a mess: java.net.URI(String) accepts only 100% valid URIs, while java.net.URI(String, String,...) encodes path and query parameters; java.net.URL(String) happily accepts for example paths with blanks, and returns these paths with blanks * implemented a simple "sanitize" mechanism in URLUtils#stringToURL(): - first try java.net.URI(String) : if the string is a valid URI, just convert the URI to an URL and return it - if java.net.URI(String) throws an exception, try java.net.URL(String): if that fails too, then give up; otherwise construct a URI with ava.net.URI(String, String,...) and retrieve the necessary params from the URL: now they are properly encoded! - finally convert the URI back to an URL using URI#toAsciiString() https://git.eclipse.org/r/#/c/6844/