Skip to content

Commit

Permalink
Fix header value types
Browse files Browse the repository at this point in the history
  • Loading branch information
mayocream committed Jan 21, 2022
1 parent 249d245 commit 4048af5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/resty/healthcheck.lua
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,14 @@ function checker:run_single_check(ip, port, hostname, hostheader)
for k, v in pairs(req_headers) do
-- `k` is header name and `v` is header value
idx = idx + 1
headers[idx] = escape_uri(k) .. ":" .. escape_uri(v)
if type(v) == "table" then
for _, item in ipairs(v) do
idx = idx + 1
headers[idx] = escape_uri(k) .. ":" .. escape_uri(item)
end
else
headers[idx] = escape_uri(k) .. ":" .. escape_uri(v)
end
end
headers = table.concat(headers, "\r\n")
end
Expand Down

0 comments on commit 4048af5

Please sign in to comment.