Skip to content

Commit 96b7f21

Browse files
NighmaredJens-G
authored andcommitted
THRIFT-5922: made http header lookup case insensitive
Client: lua
1 parent 3346c01 commit 96b7f21

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/lua/THttpTransport.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ function THttpTransport:new(obj)
4242
return TTransportBase.new(self, obj)
4343
end
4444

45+
local function THttpHeaders()
46+
local data = {}
47+
return setmetatable({}, {
48+
__index = function(_, key) return data[string.lower(key)] end,
49+
__newindex = function(_, key, value) data[string.lower(key)] = value end,
50+
__pairs = function() return pairs(data) end
51+
})
52+
end
53+
4554
function THttpTransport:isOpen()
4655
return self.trans:isOpen()
4756
end
@@ -112,7 +121,7 @@ function THttpTransport:getLine()
112121
end
113122

114123
function THttpTransport:_parseHeaders()
115-
local headers = {}
124+
local headers = THttpHeaders()
116125

117126
repeat
118127
local line = self:getLine()

0 commit comments

Comments
 (0)