From 5486726516c65bdde5c4212987f8d99edd85efcc Mon Sep 17 00:00:00 2001 From: frank <2070353930@qq.com> Date: Fri, 15 Aug 2025 21:12:07 +0800 Subject: [PATCH] Fix: it's not correct when url is new type of eclipse --- lib/download.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/download.ps1 b/lib/download.ps1 index 70641cca7f..667492bcb5 100644 --- a/lib/download.ps1 +++ b/lib/download.ps1 @@ -680,7 +680,9 @@ function ftp_file_size($url) { } function url_filename($url) { - (Split-Path $url -Leaf).split('?') | Select-Object -First 1 + # eclipse-mat mirror auto selected parameter "&r=1" + # regularly, "&" should be a part of URL + (Split-Path $url -Leaf).split('?').Split('&') | Select-Object -First 1 } function url_remote_filename($url) { @@ -688,7 +690,7 @@ function url_remote_filename($url) { # URL fragment (e.g. #/dl.7z, useful for coercing a local filename), # this function extracts the original filename from the URL. $uri = (New-Object URI $url) - $basename = Split-Path $uri.PathAndQuery -Leaf + $basename = url_filename $url If ($basename -match '.*[?=]+([\w._-]+)') { $basename = $matches[1] }