Skip to content

Commit

Permalink
Fix erroneous URL-encoding of the Maven groupId
Browse files Browse the repository at this point in the history
Fixes #4601

Signed-off-by: nscuro <[email protected]>
  • Loading branch information
nscuro committed Jan 31, 2025
1 parent 9bef0c9 commit 0cf231e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public RepositoryType supportedRepositoryType() {
public MetaModel analyze(final Component component) {
final MetaModel meta = new MetaModel(component);
if (component.getPurl() != null) {
final String mavenGavUrl = urlEncode(component.getPurl().getNamespace().replaceAll("\\.", "/")) + "/" + urlEncode(component.getPurl().getName());
final String mavenGavUrl = urlEncode(component.getPurl().getNamespace()).replaceAll("\\.", "/") + "/" + urlEncode(component.getPurl().getName());
final String url = String.format(baseUrl + REPO_METADATA_URL, mavenGavUrl);
try (final CloseableHttpResponse response = processHttpRequest(url)) {
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ public void testAnalyzerForScalaComponent() throws Exception {
Assert.assertNotNull(metaModel.getLatestVersion());
Assert.assertNotNull(metaModel.getPublishedTimestamp());
}

}

0 comments on commit 0cf231e

Please sign in to comment.