projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
81c3f36
)
util.httpstream: Fixed a possible string to number comparison error.
author
Waqas Hussain
<waqas20@gmail.com>
Fri, 5 Nov 2010 22:41:05 +0000
(
03:41
+0500)
committer
Waqas Hussain
<waqas20@gmail.com>
Fri, 5 Nov 2010 22:41:05 +0000
(
03:41
+0500)
util/httpstream.lua
patch
|
blob
|
history
diff --git
a/util/httpstream.lua
b/util/httpstream.lua
index 1aad0d916413b775c4b8b04584d65b1a19c2a69a..b567712811b56f0ffe9a254856f916a7d1998668 100644
(file)
--- 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