From df332f6c2ba64aea16bebf37d4f96092a462713c Mon Sep 17 00:00:00 2001 From: mpeterv Date: Wed, 18 Mar 2015 09:50:17 +0300 Subject: Fix url redacting when Luasocket is used Move definition of redact_api_url up so that it is visible in both Luasocket and Luasocket-less versions of Api:request --- src/luarocks/upload/api.lua | 6 +++--- 1 file 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() return nil end -local ltn12_ok, ltn12 = pcall(require, "ltn12") -if not ltn12_ok then -- If not using LuaSocket and/or LuaSec... - local function redact_api_url(url) url = tostring(url) return (url:gsub(".*/api/[^/]+/[^/]+", "")) or "" end +local ltn12_ok, ltn12 = pcall(require, "ltn12") +if not ltn12_ok then -- If not using LuaSocket and/or LuaSec... + function Api:request(url, params, post_params) local vars = cfg.variables local json_ok, json = require_json() -- cgit v1.2.3-55-g6feb