URL encoding double quotes passed in to Maven Central search API #978

This commit is contained in:
Steve Springett
2017-11-10 16:24:50 -06:00
parent 088566a2cf
commit c0dfacbf6c

View File

@@ -108,7 +108,7 @@ public class CentralSearch {
throw new IllegalArgumentException("Invalid SHA1 format");
}
List<MavenArtifact> result = null;
final URL url = new URL(String.format("%s?q=1:\"%s\"&wt=xml", rootURL, sha1));
final URL url = new URL(String.format("%s?q=1:%%22%s%%22&wt=xml", rootURL, sha1));
LOGGER.debug("Searching Central url {}", url);