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 | 56ef63ad8fd6a342f833bea13d0ec7ed3de40842 (patch) | |
tree | 5e6ce1a37d5b9e7bc9590f45fb0db7e066856bcf /net/http/parser.lua | |
parent | 31377853b753bdb401fca6af4fbb8bee3a2e5447 (diff) | |
download | prosody-56ef63ad8fd6a342f833bea13d0ec7ed3de40842.tar.gz prosody-56ef63ad8fd6a342f833bea13d0ec7ed3de40842.zip |
net.http.parser: Convert status_code to a number before trying to compare it to numbers
Diffstat (limited to 'net/http/parser.lua')
-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") |