diff options
author | Matthew Wild <mwild1@gmail.com> | 2013-04-11 19:58:53 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2013-04-11 19:58:53 +0100 |
commit | 1ebc90c25bfb3e02c4b2f0bbee59c84bcc330299 (patch) | |
tree | 5e6ce1a37d5b9e7bc9590f45fb0db7e066856bcf | |
parent | 70a407116ffcc523fcd8cb5285e4f0977a1c6d35 (diff) | |
download | prosody-1ebc90c25bfb3e02c4b2f0bbee59c84bcc330299.tar.gz prosody-1ebc90c25bfb3e02c4b2f0bbee59c84bcc330299.zip |
net.http.parser: Convert status_code to a number before trying to compare it to numbers
-rw-r--r-- | net/http/parser.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/http/parser.lua b/net/http/parser.lua index 73a8fb6a..684d62fe 100644 --- 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") |