diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2015-03-18 17:32:05 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2015-03-18 17:32:05 -0300 |
commit | d820069d67fbae82d9e50cc347704399d34a4464 (patch) | |
tree | 3f2c02ca37e477f81f029fdc1a978df67e0d03bf /src | |
parent | 87398473ce42a42391565dbe26a5ad37a7d53fd3 (diff) | |
parent | df332f6c2ba64aea16bebf37d4f96092a462713c (diff) | |
download | luarocks-d820069d67fbae82d9e50cc347704399d34a4464.tar.gz luarocks-d820069d67fbae82d9e50cc347704399d34a4464.tar.bz2 luarocks-d820069d67fbae82d9e50cc347704399d34a4464.zip |
Merge pull request #326 from mpeterv/fix-redact-api
Fix url redacting when Luasocket is used
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/upload/api.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/luarocks/upload/api.lua b/src/luarocks/upload/api.lua index 6dfb98df..3ab271ad 100644 --- a/src/luarocks/upload/api.lua +++ b/src/luarocks/upload/api.lua | |||
@@ -116,14 +116,14 @@ local function require_json() | |||
116 | return nil | 116 | return nil |
117 | end | 117 | end |
118 | 118 | ||
119 | local ltn12_ok, ltn12 = pcall(require, "ltn12") | ||
120 | if not ltn12_ok then -- If not using LuaSocket and/or LuaSec... | ||
121 | |||
122 | local function redact_api_url(url) | 119 | local function redact_api_url(url) |
123 | url = tostring(url) | 120 | url = tostring(url) |
124 | return (url:gsub(".*/api/[^/]+/[^/]+", "")) or "" | 121 | return (url:gsub(".*/api/[^/]+/[^/]+", "")) or "" |
125 | end | 122 | end |
126 | 123 | ||
124 | local ltn12_ok, ltn12 = pcall(require, "ltn12") | ||
125 | if not ltn12_ok then -- If not using LuaSocket and/or LuaSec... | ||
126 | |||
127 | function Api:request(url, params, post_params) | 127 | function Api:request(url, params, post_params) |
128 | local vars = cfg.variables | 128 | local vars = cfg.variables |
129 | local json_ok, json = require_json() | 129 | local json_ok, json = require_json() |