Software /
code /
prosody
Diff
util/httpstream.lua @ 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 |
parent | 3567:94828fb2dab8 |
child | 3570:6ef68af9431c |
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