Changeset

5462:3ecae471d9dd

net.http.parser: Convert status_code to a number before trying to compare it to numbers
author Matthew Wild <mwild1@gmail.com>
date Thu, 11 Apr 2013 19:58:53 +0100
parents 5461:67b674f6a299
children 5463:111953bfe767
files net/http/parser.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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")