From f4334cfa053acac57e98a50341e894d613c35a9a Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sat, 6 Nov 2010 03:41:05 +0500 Subject: util.httpstream: Fixed a possible string to number comparison error. --- util/httpstream.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/httpstream.lua b/util/httpstream.lua index 1aad0d91..b5677128 100644 --- a/util/httpstream.lua +++ b/util/httpstream.lua @@ -67,7 +67,8 @@ local function parser(success_cb, parser_type, options_cb) -- read status line local status_line = readline(); local httpversion, status_code, reason_phrase = status_line:match("^HTTP/(%S+)%s+(%d%d%d)%s+(.*)$"); - if not httpversion then coroutine.yield("invalid-status-line"); end + status_code = tonumber(status_code); + if not status_code then coroutine.yield("invalid-status-line"); end local headers = readheaders(); -- read body -- cgit v1.2.3