Skip to content

Commit 0ecbcf8

Browse files
committed
Removed metamethod rawget which can never run
1 parent 363f4a3 commit 0ecbcf8

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/resty/http_headers.lua

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,9 @@ function _M.new(self)
4747
}
4848

4949
mt.__index = function(t, k)
50-
local matched = rawget(t, k)
51-
if matched then
52-
return matched
53-
else
54-
local k_hyphened = hyphenate(k)
55-
local k_normalised = str_lower(k_hyphened)
56-
return rawget(t, mt.normalised[k_normalised])
57-
end
50+
local k_hyphened = hyphenate(k)
51+
local k_normalised = str_lower(k_hyphened)
52+
return rawget(t, mt.normalised[k_normalised])
5853
end
5954

6055
-- First check the normalised table. If there's no match (first time) add an entry for

0 commit comments

Comments
 (0)