|
|
@ -23,7 +23,9 @@ |
|
|
|
test_20122010/1, |
|
|
|
test_pipeline_head_timeout/0, |
|
|
|
test_pipeline_head_timeout/1, |
|
|
|
do_test_pipeline_head_timeout/4 |
|
|
|
do_test_pipeline_head_timeout/4, |
|
|
|
test_head_transfer_encoding/0, |
|
|
|
test_head_transfer_encoding/1 |
|
|
|
]). |
|
|
|
|
|
|
|
test_stream_once(Url, Method, Options) -> |
|
|
@ -227,7 +229,8 @@ dump_errors(Key, Iod) -> |
|
|
|
{"http://www.httpwatch.com/httpgallery/chunked/", get}, |
|
|
|
{"https://github.com", get, [{ssl_options, [{depth, 2}]}]}, |
|
|
|
{local_test_fun, test_20122010, []}, |
|
|
|
{local_test_fun, test_pipeline_head_timeout, []} |
|
|
|
{local_test_fun, test_pipeline_head_timeout, []}, |
|
|
|
{local_test_fun, test_head_transfer_encoding, []} |
|
|
|
]). |
|
|
|
|
|
|
|
unit_tests() -> |
|
|
@ -436,7 +439,22 @@ log_msg(Fmt, Args) -> |
|
|
|
io:format("~s -- " ++ Fmt, |
|
|
|
[ibrowse_lib:printable_date() | Args]). |
|
|
|
|
|
|
|
%%------------------------------------------------------------------------------ |
|
|
|
%% Test what happens when the response to a HEAD request is a |
|
|
|
%% Chunked-Encoding response with a non-empty body. Issue #67 on |
|
|
|
%% Github |
|
|
|
%% ------------------------------------------------------------------------------ |
|
|
|
test_head_transfer_encoding() -> |
|
|
|
clear_msg_q(), |
|
|
|
test_head_transfer_encoding("http://localhost:8181/ibrowse_head_transfer_enc"). |
|
|
|
|
|
|
|
test_head_transfer_encoding(Url) -> |
|
|
|
case ibrowse:send_req(Url, [], head) of |
|
|
|
{ok, "400", _, _} -> |
|
|
|
success; |
|
|
|
Res -> |
|
|
|
{test_failed, Res} |
|
|
|
end. |
|
|
|
%%------------------------------------------------------------------------------ |
|
|
|
%% Test what happens when the request at the head of a pipeline times out |
|
|
|
%%------------------------------------------------------------------------------ |
|
|
|