diff options
author | Kim Alvefur <zash@zash.se> | 2020-08-01 18:41:23 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-08-01 18:41:23 +0200 |
commit | eefe8a76880872993d0f65f600830b91caabbe23 (patch) | |
tree | 792a543eb0ec61821a6c9d439fca75dfed685c4f /spec | |
parent | 55a5af04f19344a497dcf17e3a762e9b7da72d29 (diff) | |
download | prosody-eefe8a76880872993d0f65f600830b91caabbe23.tar.gz prosody-eefe8a76880872993d0f65f600830b91caabbe23.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.lua | 8 |
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); |