summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/private/action/require/impl/actions/download.lua4
-rw-r--r--xmake/modules/private/action/require/impl/actions/download_resources.lua4
-rw-r--r--xmake/modules/private/action/require/impl/actions/patch_sources.lua4
3 files changed, 9 insertions, 3 deletions
diff --git a/xmake/modules/private/action/require/impl/actions/download.lua b/xmake/modules/private/action/require/impl/actions/download.lua
index f6070021d..336d07211 100644
--- a/xmake/modules/private/action/require/impl/actions/download.lua
+++ b/xmake/modules/private/action/require/impl/actions/download.lua
@@ -164,7 +164,9 @@ function _download(package, url, sourcedir, url_alias, url_excludes)
-- we can use local package from the search directories directly if network is too slow
os.cp(localfile, packagefile)
else
- http.download(url, packagefile, {insecure = global.get("insecure-ssl")})
+ http.download(url, packagefile, {
+ insecure = global.get("insecure-ssl"),
+ headers = package:policy("package.download.http_headers")})
end
end
diff --git a/xmake/modules/private/action/require/impl/actions/download_resources.lua b/xmake/modules/private/action/require/impl/actions/download_resources.lua
index 5373fd81f..a62d3a3af 100644
--- a/xmake/modules/private/action/require/impl/actions/download_resources.lua
+++ b/xmake/modules/private/action/require/impl/actions/download_resources.lua
@@ -114,7 +114,9 @@ function _download(package, resource_name, resource_url, resource_hash)
-- we can use local resource from the search directories directly if network is too slow
os.cp(localfile, resource_file)
elseif resource_url:find(string.ipattern("https-://")) or resource_url:find(string.ipattern("ftps-://")) then
- http.download(resource_url, resource_file, {insecure = global.get("insecure-ssl")})
+ http.download(resource_url, resource_file, {
+ insecure = global.get("insecure-ssl"),
+ headers = package:policy("package.download.http_headers")})
else
raise("invalid resource url(%s)", resource_url)
end
diff --git a/xmake/modules/private/action/require/impl/actions/patch_sources.lua b/xmake/modules/private/action/require/impl/actions/patch_sources.lua
index 10b89c911..cef9aa692 100644
--- a/xmake/modules/private/action/require/impl/actions/patch_sources.lua
+++ b/xmake/modules/private/action/require/impl/actions/patch_sources.lua
@@ -73,7 +73,9 @@ function _patch(package, patch_url, patch_hash)
-- download the patch file
if patch_url:find(string.ipattern("https-://")) or patch_url:find(string.ipattern("ftps-://")) then
- http.download(patch_url, patch_file)
+ http.download(patch_url, patch_file, {
+ insecure = global.get("insecure-ssl"),
+ headers = package:policy("package.download.http_headers")})
else
-- copy the patch file
if os.isfile(patch_url) then