diff options
author | Christian Hesse <mail@eworm.de> | 2024-03-27 23:35:01 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2024-04-06 00:47:16 +0200 |
commit | 2edf983698a18d45de1c9e7823dad0959bff2504 (patch) | |
tree | 9d5318578bfcd8fd868a0fcecd88cd5269f25035 | |
parent | ab6fd8855881681d7c69af3e5ce18b3a6e2e69fb (diff) |
global-functions: $FetchHuge: control check-certificate with parameter
-rw-r--r-- | global-functions.rsc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/global-functions.rsc b/global-functions.rsc index 0ea7120..65dd06e 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -392,15 +392,19 @@ # fetch huge data to file, read in chunks :set FetchHuge do={ - :local ScriptName [ :tostr $1 ]; - :local Url [ :tostr $2 ]; + :local ScriptName [ :tostr $1 ]; + :local Url [ :tostr $2 ]; + :local CheckCert [ :tobool $3 ]; :global FetchUserAgentStr; :global GetRandom20CharAlNum; + :global IfThenElse; :global LogPrint; :global MkDir; :global WaitForFile; + :set CheckCert [ $IfThenElse ($CheckCert = false) "no" "yes-without-crl" ]; + :if ([ $MkDir "tmpfs/" . $ScriptName ] = false) do={ $LogPrint error $0 ("Failed creating directory!"); :return false; @@ -409,7 +413,7 @@ :local FileName ("tmpfs/" . $ScriptName . "/" . $0 . "-" . [ $GetRandom20CharAlNum ]); :do { - /tool/fetch check-certificate=yes-without-crl $Url dst-path=$FileName \ + /tool/fetch check-certificate=$CheckCert $Url dst-path=$FileName \ http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) as-value; } on-error={ $LogPrint debug $0 ("Failed downloading from: " . $Url); |