diff options
| author | Ignacio Burgueño <ignaciob@inconcertcc.com> | 2015-04-17 12:22:54 -0300 |
|---|---|---|
| committer | Ignacio Burgueño <ignaciob@inconcertcc.com> | 2015-04-17 12:22:54 -0300 |
| commit | f022fe08167e67ae854120d472d273bed47ff3ff (patch) | |
| tree | d131221243a3d354b01a1a4872928246ec51ba30 | |
| parent | b6b67547ef5801502f1b63ec62c04923ceb77cef (diff) | |
| download | luarocks-f022fe08167e67ae854120d472d273bed47ff3ff.tar.gz luarocks-f022fe08167e67ae854120d472d273bed47ff3ff.tar.bz2 luarocks-f022fe08167e67ae854120d472d273bed47ff3ff.zip | |
Drop use of config.proxy
Alwways fallback to defined downloader if https_proxy env var is set.
| -rw-r--r-- | src/luarocks/cfg.lua | 3 | ||||
| -rw-r--r-- | src/luarocks/fs/lua.lua | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index ba8c7f22..b7e76535 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
| @@ -595,6 +595,9 @@ end | |||
| 595 | 595 | ||
| 596 | cfg.user_agent = "LuaRocks/"..cfg.program_version.." "..cfg.arch | 596 | cfg.user_agent = "LuaRocks/"..cfg.program_version.." "..cfg.arch |
| 597 | 597 | ||
| 598 | cfg.http_proxy = os.getenv("http_proxy") | ||
| 599 | cfg.https_proxy = os.getenv("https_proxy") | ||
| 600 | |||
| 598 | --- Check if platform was detected | 601 | --- Check if platform was detected |
| 599 | -- @param query string: The platform name to check. | 602 | -- @param query string: The platform name to check. |
| 600 | -- @return boolean: true if LuaRocks is currently running on queried platform. | 603 | -- @return boolean: true if LuaRocks is currently running on queried platform. |
diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua index 48db4a0d..1a2ec888 100644 --- a/src/luarocks/fs/lua.lua +++ b/src/luarocks/fs/lua.lua | |||
| @@ -545,7 +545,7 @@ local redirect_protocols = { | |||
| 545 | local function request(url, method, http, loop_control) | 545 | local function request(url, method, http, loop_control) |
| 546 | local result = {} | 546 | local result = {} |
| 547 | 547 | ||
| 548 | local proxy = cfg.proxy | 548 | local proxy = cfg.http_proxy |
| 549 | if type(proxy) ~= "string" then proxy = nil end | 549 | if type(proxy) ~= "string" then proxy = nil end |
| 550 | -- LuaSocket's http.request crashes when given URLs missing the scheme part. | 550 | -- LuaSocket's http.request crashes when given URLs missing the scheme part. |
| 551 | if proxy and not proxy:find("://") then | 551 | if proxy and not proxy:find("://") then |
| @@ -660,7 +660,7 @@ function fs_lua.download(url, filename, cache) | |||
| 660 | elseif util.starts_with(url, "ftp:") then | 660 | elseif util.starts_with(url, "ftp:") then |
| 661 | content, err = ftp.get(url) | 661 | content, err = ftp.get(url) |
| 662 | elseif util.starts_with(url, "https:") then | 662 | elseif util.starts_with(url, "https:") then |
| 663 | if luasec_ok then | 663 | if luasec_ok and not cfg.https_proxy then |
| 664 | content, err = http_request(url, https, cache and filename) | 664 | content, err = http_request(url, https, cache and filename) |
| 665 | else | 665 | else |
| 666 | https_err = true | 666 | https_err = true |
