From 9c1c7eda8b29f90383af70d87de67fd17ba2a738 Mon Sep 17 00:00:00 2001 From: kevprice83 Date: Wed, 20 Jan 2021 13:07:35 +0100 Subject: [PATCH] moves get_method function after conditional check --- .../policy/rewrite_url_captures/named_args_matcher.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gateway/src/apicast/policy/rewrite_url_captures/named_args_matcher.lua b/gateway/src/apicast/policy/rewrite_url_captures/named_args_matcher.lua index 4383b3fcf..851a52d4d 100644 --- a/gateway/src/apicast/policy/rewrite_url_captures/named_args_matcher.lua +++ b/gateway/src/apicast/policy/rewrite_url_captures/named_args_matcher.lua @@ -114,12 +114,12 @@ end -- Returns true if no Method is provided in the config for backwardscompatibility local function is_match_methods(methods) - local request_method = ngx.req.get_method() - if methods == nil or next(methods) == nil then return true end + local request_method = ngx.req.get_method() + for _,v in pairs(methods) do if v == request_method then return true