# HG changeset patch # User Matthew Wild # Date 1365706733 -3600 # Node ID 3ecae471d9dd1876e7c55a41714f4e24789bb1cc # Parent 67b674f6a2994e8827301fb0b50d66f8ffef0358 net.http.parser: Convert status_code to a number before trying to compare it to numbers diff -r 67b674f6a299 -r 3ecae471d9dd net/http/parser.lua --- a/net/http/parser.lua Thu Apr 11 17:39:10 2013 +0100 +++ b/net/http/parser.lua Thu Apr 11 19:58:53 2013 +0100 @@ -65,6 +65,7 @@ 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")