Skip to content

Commit

Permalink
Merge pull request Kong#1050 from Mashape/fix/plugins-load
Browse files Browse the repository at this point in the history
Fixing a bug when loading custom plugins
  • Loading branch information
subnetmarco committed Mar 10, 2016
2 parents 2abc525 + 2e1931e commit 29fd36f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kong/tools/config_loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function _M.load(config_path)
config.nginx_working_dir = fs.current_dir().."/"..config.nginx_working_dir
end

config.plugins = utils.table_merge(constants.PLUGINS_AVAILABLE, config.custom_plugins)
config.plugins = utils.concat(constants.PLUGINS_AVAILABLE, config.custom_plugins)

return config, config_path
end
Expand Down
10 changes: 10 additions & 0 deletions kong/tools/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,16 @@ end

local err_list_mt = {}

--- Concatenates lists into a new table.
function _M.concat(...)
local result = {}
local insert = table.insert
for _, t in ipairs({...}) do
for _, v in ipairs(t) do insert(result, v) end
end
return result
end

--- Add an error message to a key/value table.
-- If the key already exists, a sub table is created with the original and the new value.
-- @param errors (Optional) Table to attach the error to. If `nil`, the table will be created.
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/proxy/dns_resolver_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("DNS", function()

thread:join()
end)
it("should work when calling local hostname #ci", function()
it("should work when calling local hostname", function()
local thread = spec_helper.start_http_server(TCP_PORT) -- Starting the mock TCP server
local _, status = http_client.get(spec_helper.STUB_GET_URL, nil, { host = "dns2.com" })
assert.are.equal(200, status)
Expand Down
2 changes: 1 addition & 1 deletion spec/plugins/logging_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ end
local mock_bin_http = create_mock_bin()
local mock_bin_https = create_mock_bin()

describe("Logging Plugins #ci", function()
describe("Logging Plugins", function()

setup(function()
spec_helper.prepare_db()
Expand Down

0 comments on commit 29fd36f

Please sign in to comment.