aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-03-27 23:37:31 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-04-06 00:45:50 +0200
commitab6fd8855881681d7c69af3e5ce18b3a6e2e69fb (patch)
treee71b91ad69b3389928094b64585064f92362fd6e /global-functions.rsc
parent5323052290177ff3cfbae5f80a846f5657ae9afd (diff)
global-functions: $FetchHuge: use custom user agent string
Diffstat (limited to 'global-functions.rsc')
-rw-r--r--global-functions.rsc4
1 files changed, 3 insertions, 1 deletions
diff --git a/global-functions.rsc b/global-functions.rsc
index bd35cdf..0ea7120 100644
--- a/global-functions.rsc
+++ b/global-functions.rsc
@@ -395,6 +395,7 @@
:local ScriptName [ :tostr $1 ];
:local Url [ :tostr $2 ];
+ :global FetchUserAgentStr;
:global GetRandom20CharAlNum;
:global LogPrint;
:global MkDir;
@@ -408,7 +409,8 @@
:local FileName ("tmpfs/" . $ScriptName . "/" . $0 . "-" . [ $GetRandom20CharAlNum ]);
:do {
- /tool/fetch check-certificate=yes-without-crl $Url dst-path=$FileName as-value;
+ /tool/fetch check-certificate=yes-without-crl $Url dst-path=$FileName \
+ http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) as-value;
} on-error={
$LogPrint debug $0 ("Failed downloading from: " . $Url);
:return false;