File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -680,15 +680,17 @@ function ftp_file_size($url) {
680680}
681681
682682function 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
686688function 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 }
You can’t perform that action at this time.
0 commit comments