Skip to content

Commit

Permalink
fix(http): Fix parse HTTP/1.0 in recv_status_line
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <[email protected]>
  • Loading branch information
zhaojh329 committed Apr 25, 2024
1 parent 46680f6 commit b058b52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion http/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ local function recv_status_line(sock, timeout)
return nil, err
end

local code, status = data:match('^HTTP/1.1 +(%d+) +([%w%p ]*)\r?$')
local code, status = data:match('^HTTP/1.[01] +(%d+) +([%w%p ]*)\r?$')
if not code or not status then
return nil, 'invalid http status line'
end
Expand Down

0 comments on commit b058b52

Please sign in to comment.