elharo commented on code in PR #109:
URL: https://github.com/apache/maven-shared-io/pull/109#discussion_r3696510888
##########
src/main/java/org/apache/maven/shared/io/download/DefaultDownloadManager.java:
##########
@@ -115,8 +115,20 @@ public File download(String url, List<TransferListener>
transferListeners, Messa
messageHolder.addMessage("Download target is: " +
downloaded.getAbsolutePath());
// split the download URL into base URL and remote path for
connecting, then retrieving.
+ // Build baseUrl from URL components to avoid corruption by query
strings or fragments.
+ // The authority is used verbatim so that user info (including any
password), port and
+ // bracketed IPv6 hosts survive; Repository re-parses them out of the
base URL.
String remotePath = sourceUrl.getPath();
- String baseUrl = url.substring(0, url.length() - remotePath.length());
+ String authority = sourceUrl.getAuthority();
+
+ // Repository can only parse an authority-less base URL for the file
protocol, so reject
Review Comment:
I'm not sure what this comment means. Repositories don't parse URLs
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]