Changeset

3568:51d5578965a5

util.httpstream: Fixed a possible string to number comparison error.
author Waqas Hussain <waqas20@gmail.com>
date Sat, 06 Nov 2010 03:41:05 +0500
parents 3567:94828fb2dab8
children 3569:f30da46e0add
files util/httpstream.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/httpstream.lua	Sat Nov 06 01:58:46 2010 +0500
+++ b/util/httpstream.lua	Sat Nov 06 03:41:05 2010 +0500
@@ -67,7 +67,8 @@
 			-- 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