From cd057d8a3c4d537e2acc3a80b88693a43e52367e Mon Sep 17 00:00:00 2001 From: MrAdhit Date: Thu, 4 Jan 2024 19:57:15 -0800 Subject: [PATCH] fix weird http code (#552) --- run.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/run.ps1 b/run.ps1 index 27f4375..07709f9 100644 --- a/run.ps1 +++ b/run.ps1 @@ -434,8 +434,8 @@ function downloadSp() { try { if ($curl_check) { - $stcode = curl.exe -s -w "%{http_code}" -o /dev/null $web_Url --retry 2 --ssl-no-revoke - if ($stcode -ne "200") { + $stcode = curl.exe -Is -w "%{http_code} \n" -o /dev/null $web_Url --retry 2 --ssl-no-revoke + if ($stcode.trim() -ne "200") { Write-Host "Curl error code: $stcode"; throw } curl.exe -q $web_Url -o $local_Url --progress-bar --retry 3 --ssl-no-revoke @@ -462,8 +462,8 @@ function downloadSp() { try { if ($curl_check) { - $stcode = curl.exe -s -w "%{http_code}" -o /dev/null $web_Url --retry 2 --ssl-no-revoke - if ($stcode -ne "200") { + $stcode = curl.exe -Is -w "%{http_code} \n" -o /dev/null $web_Url --retry 2 --ssl-no-revoke + if ($stcode.trim() -ne "200") { Write-Host "Curl error code: $stcode"; throw } curl.exe -q $web_Url -o $local_Url --progress-bar --retry 3 --ssl-no-revoke