projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a89893
)
net.http.parser: Convert status_code to a number before trying to compare it to numbers
author
Matthew Wild
<mwild1@gmail.com>
Thu, 11 Apr 2013 18:58:53 +0000
(19:58 +0100)
committer
Matthew Wild
<mwild1@gmail.com>
Thu, 11 Apr 2013 18:58:53 +0000
(19:58 +0100)
net/http/parser.lua
patch
|
blob
|
history
diff --git
a/net/http/parser.lua
b/net/http/parser.lua
index 73a8fb6a4287d609c509b0589a10a6d83b799826..684d62febcef2189945d68f0633fea0df21afe64 100644
(file)
--- a/
net/http/parser.lua
+++ b/
net/http/parser.lua
@@
-65,6
+65,7
@@
function httpstream.new(success_cb, error_cb, parser_type, options_cb)
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")