From 14084ec7fffd35bb7c51741bc3bedbf7cbb27538 Mon Sep 17 00:00:00 2001 From: suika Date: Thu, 30 Jun 2022 12:09:03 +0800 Subject: [PATCH] apply suggestions --- kong/db/migrations/core/016_280_to_300.lua | 5 ++--- spec/01-unit/08-router_spec.lua | 3 +-- spec/02-integration/05-proxy/02-router_spec.lua | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/kong/db/migrations/core/016_280_to_300.lua b/kong/db/migrations/core/016_280_to_300.lua index 103b50e25535..438cf06a14e2 100644 --- a/kong/db/migrations/core/016_280_to_300.lua +++ b/kong/db/migrations/core/016_280_to_300.lua @@ -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 @@ -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 diff --git a/spec/01-unit/08-router_spec.lua b/spec/01-unit/08-router_spec.lua index ab3c17161d6d..5663f0f8c243 100644 --- a/spec/01-unit/08-router_spec.lua +++ b/spec/01-unit/08-router_spec.lua @@ -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 = { diff --git a/spec/02-integration/05-proxy/02-router_spec.lua b/spec/02-integration/05-proxy/02-router_spec.lua index 6901341b799f..2bfd1d3858aa 100644 --- a/spec/02-integration/05-proxy/02-router_spec.lua +++ b/spec/02-integration/05-proxy/02-router_spec.lua @@ -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