aboutsummaryrefslogtreecommitdiffstats
path: root/net/http/parser.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2014-09-03 18:50:20 +0100
committerMatthew Wild <mwild1@gmail.com>2014-09-03 18:50:20 +0100
commit74191c88a70bbb04baab491c1252e6d3fa090f4f (patch)
treeb2a636d33d28c077107980aa139233b63accdee4 /net/http/parser.lua
parent2781a9aa2528fd7a21d4b07c553f7cab3377e4d9 (diff)
parent5035900778c4e2fa078511c5c38754da5a834ff1 (diff)
downloadprosody-74191c88a70bbb04baab491c1252e6d3fa090f4f.tar.gz
prosody-74191c88a70bbb04baab491c1252e6d3fa090f4f.zip
Merge 0.9->0.10
Diffstat (limited to 'net/http/parser.lua')
-rw-r--r--net/http/parser.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/http/parser.lua b/net/http/parser.lua
index f9e6cea0..d896dff4 100644
--- a/net/http/parser.lua
+++ b/net/http/parser.lua
@@ -140,7 +140,11 @@ function httpstream.new(success_cb, error_cb, parser_type, options_cb)
break;
end
elseif len and #buf >= len then
- packet.body, buf = buf:sub(1, len), buf:sub(len + 1);
+ if packet.code == 101 then
+ packet.body, buf = buf, ""
+ else
+ packet.body, buf = buf:sub(1, len), buf:sub(len + 1);
+ end
state = nil; success_cb(packet);
else
break;