Skip to content

Commit 4c94689

Browse files
author
frank
committed
Bug: it's not correct when url is new type of eclipse
1 parent b588a06 commit 4c94689

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/download.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,15 +680,17 @@ function ftp_file_size($url) {
680680
}
681681

682682
function url_filename($url) {
683-
(Split-Path $url -Leaf).split('?') | Select-Object -First 1
683+
# eclipse-mat mirror auto selected parameter "&r=1"
684+
# regularly, "&" should be a part of URL
685+
(Split-Path $url -Leaf).split('?').Split('&') | Select-Object -First 1
684686
}
685687

686688
function url_remote_filename($url) {
687689
# Unlike url_filename which can be tricked by appending a
688690
# URL fragment (e.g. #/dl.7z, useful for coercing a local filename),
689691
# this function extracts the original filename from the URL.
690692
$uri = (New-Object URI $url)
691-
$basename = Split-Path $uri.PathAndQuery -Leaf
693+
$basename = url_filename $url
692694
If ($basename -match '.*[?=]+([\w._-]+)') {
693695
$basename = $matches[1]
694696
}

0 commit comments

Comments
 (0)