Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(external-plugins): use lowercase for comparing string in error condition #7153

Merged
merged 1 commit into from
May 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kong/db/dao/plugins/go.lua
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ local get_plugin do

local instance_id = get_instance(plugin_name, conf)
local _, err = bridge_loop(instance_id, phase)
if err and string.match(err, "No plugin instance") then
if err and string.match(err:lower(), "no plugin instance") then
instance_id = reset_and_get_instance(plugin_name, conf)
bridge_loop(instance_id, phase)
end
Expand All @@ -531,7 +531,7 @@ local get_plugin do
plugin[phase] = function(self, conf)
local instance_id = get_instance(plugin_name, conf)
local _, err = bridge_loop(instance_id, phase)
if err and string.match(err, "No plugin instance") then
if err and string.match(err:lower(), "no plugin instance") then
instance_id = reset_and_get_instance(plugin_name, conf)
bridge_loop(instance_id, phase)
end
Expand Down
2 changes: 1 addition & 1 deletion kong/runloop/plugin_servers/mp_rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ function Rpc:handle_event(plugin_name, conf, phase)
if err then
kong.log.err(err)

if string.match(err, "No plugin instance") then
if string.match(err:lower(), "no plugin instance") then
self.reset_instance(plugin_name, conf)
return self:handle_event(plugin_name, conf, phase)
end
Expand Down
2 changes: 1 addition & 1 deletion kong/runloop/plugin_servers/pb_rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ function Rpc:handle_event(plugin_name, conf, phase)
if not res then
kong.log.err(err)

if string.match(err, "No plugin instance") then
if string.match(err:lower(), "no plugin instance") then
self.reset_instance(plugin_name, conf)
return self:handle_event(plugin_name, conf, phase)
end
Expand Down