summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/net/http/download.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/xmake/modules/net/http/download.lua b/xmake/modules/net/http/download.lua
index 0b266a248..038d3fb03 100644
--- a/xmake/modules/net/http/download.lua
+++ b/xmake/modules/net/http/download.lua
@@ -85,6 +85,14 @@ function _curl_download(tool, url, outputfile, opt)
table.insert(argv, "-k")
end
+ -- add custom headers
+ if opt.headers then
+ for _, header in ipairs(opt.headers) do
+ table.insert(argv, "-H")
+ table.insert(argv, header)
+ end
+ end
+
-- continue to download?
if opt.continue then
table.insert(argv, "-C")
@@ -150,6 +158,13 @@ function _wget_download(tool, url, outputfile, opt)
table.insert(argv, "--no-check-certificate")
end
+ -- add custom headers
+ if opt.headers then
+ for _, header in ipairs(opt.headers) do
+ table.insert(argv, "--header=" .. header)
+ end
+ end
+
-- continue to download?
if opt.continue then
table.insert(argv, "-c")