Skip to content

Commit

Permalink
fix check header limit
Browse files Browse the repository at this point in the history
  • Loading branch information
lvzixun authored and cloudwu committed Mar 28, 2019
1 parent ee1f505 commit ea0cc1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lualib/http/internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ function M.recvheader(readbytes, lines, header)
while true do
local bytes = readbytes()
header = header .. bytes
if #header > LIMIT then
return
end
e = header:find("\r\n\r\n", -#bytes-3, true)
if e then
result = header:sub(e+4)
Expand All @@ -59,6 +56,9 @@ function M.recvheader(readbytes, lines, header)
if header:find "^\r\n" then
return header:sub(3)
end
if #header > LIMIT then
return
end
end
end
for v in header:gmatch("(.-)\r\n") do
Expand Down

0 comments on commit ea0cc1f

Please sign in to comment.