Skip to content

Commit 9b57930

Browse files
committed
bugfix: treat Expect header value case-insensitive
1 parent a2a6fec commit 9b57930

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/resty/requests/request.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ local insert = table.insert
1414
local concat = table.concat
1515
local find = string.find
1616
local sub = string.sub
17+
local lower = string.lower
1718
local format = string.format
1819
local ngx_match = ngx.re.match
1920
local _M = { _VERSION = "0.2" }
@@ -146,7 +147,7 @@ local function new(method, url, session, config)
146147

147148
local body = prepare(url_parts, session, config)
148149

149-
local expect = session.headers["expect"] == "100-continue"
150+
local expect = lower(session.headers["expect"]) == "100-continue"
150151

151152
local r = {
152153
method = method,

0 commit comments

Comments
 (0)