aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-08-01 18:41:23 +0200
committerKim Alvefur <zash@zash.se>2020-08-01 18:41:23 +0200
commit91d2ab91086d2aebcbc4d47a5bce05c6cd3abdcb (patch)
tree792a543eb0ec61821a6c9d439fca75dfed685c4f /spec
parent64aa6a2a0e704221821cb53ccd90e19fabfa475e (diff)
downloadprosody-91d2ab91086d2aebcbc4d47a5bce05c6cd3abdcb.tar.gz
prosody-91d2ab91086d2aebcbc4d47a5bce05c6cd3abdcb.zip
net.http.parser: Allow specifying sink for large request bodies
This enables uses such as saving uploaded files directly to a file on disk or streaming parsing of payloads. See #726
Diffstat (limited to 'spec')
-rw-r--r--spec/net_http_parser_spec.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/net_http_parser_spec.lua b/spec/net_http_parser_spec.lua
index 8310a451..4ac3cab9 100644
--- a/spec/net_http_parser_spec.lua
+++ b/spec/net_http_parser_spec.lua
@@ -3,7 +3,9 @@ local http_parser = require "net.http.parser";
local function test_stream(stream, expect)
local success_cb = spy.new(function (packet)
assert.is_table(packet);
- assert.is_equal(expect.body, packet.body);
+ if packet.body ~= false then
+ assert.is_equal(expect.body, packet.body);
+ end
end);
stream = stream:gsub("\n", "\r\n");
@@ -79,7 +81,7 @@ o
]],
{
- body = "Hello", count = 1;
+ body = "Hello", count = 2;
}
);
end);
@@ -108,7 +110,7 @@ o
]],
{
- body = "Hello", count = 2;
+ body = "Hello", count = 3;
}
);
end);