Skip to content

Commit

Permalink
apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
StarlightIbuki committed Jun 30, 2022
1 parent 4e6873d commit 14084ec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions kong/db/migrations/core/016_280_to_300.lua
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,10 @@ local function c_normalize_regex_path(coordinator)

local changed = false
for i, path in ipairs(route.paths) do
print(path)
if not is_regex(path) then
goto continue
end

local normalized_path = migrate_regex(path)
if normalized_path ~= path then
changed = true
Expand Down Expand Up @@ -336,17 +336,16 @@ end

local function p_migrate_regex_path(connector)
for route, err in connector:iterate("SELECT id, paths FROM routes") do
print(require "inspect" (route))
if err then
return nil, err
end

local changed = false
for i, path in ipairs(route.paths) do
print(path)
if not is_regex(path) then
goto continue
end

local normalized_path = migrate_regex(path)
if normalized_path ~= path then
changed = true
Expand Down
3 changes: 1 addition & 2 deletions spec/01-unit/08-router_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1476,8 +1476,7 @@ describe("Router", function()
},
},
},
-- regex
-- regex will no longer be normalized since 3.0
-- regex. It will no longer be normalized since 3.0
{
service = service,
route = {
Expand Down
1 change: 1 addition & 0 deletions spec/02-integration/05-proxy/02-router_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local helpers = require "spec.helpers"
local cjson = require "cjson"
local path_handling_tests = require "spec.fixtures.router_path_handling_tests"

local tonumber = tonumber

local enable_buffering
local enable_buffering_plugin
Expand Down

0 comments on commit 14084ec

Please sign in to comment.