From 358b0b204c09ad931cf4ccb1dce642094074f889 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 11 Apr 2013 19:58:53 +0100 Subject: net.http.parser: Convert status_code to a number before trying to compare it to numbers --- net/http/parser.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'net') diff --git a/net/http/parser.lua b/net/http/parser.lua index 73a8fb6a..684d62fe 100644 --- a/net/http/parser.lua +++ b/net/http/parser.lua @@ -65,6 +65,7 @@ function httpstream.new(success_cb, error_cb, parser_type, options_cb) first_line = line; if client then httpversion, status_code, reason_phrase = line:match("^HTTP/(1%.[01]) (%d%d%d) (.*)$"); + status_code = tonumber(status_code); if not status_code then error = true; return error_cb("invalid-status-line"); end have_body = not ( (options_cb and options_cb().method == "HEAD") -- cgit v1.2.3