Skip to content

Commit 68bc174

Browse files
committed
Merge pull request #69 from nathanaschbacher/master
Updated http_raw driver to allow appending custom headers.
2 parents f2641a4 + 041b1a7 commit 68bc174

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

examples/httpraw.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
{driver, basho_bench_driver_http_raw}.
88

9+
%% Example custom headers. Beware using headers that may cause collisions
10+
%% with automatically generated headers used by other parts of the driver.
11+
%% {http_raw_append_headers, [{"Authorization", "Basic dXNlcm5hbWU6cGFzc3dvcmQ="}]}.
12+
913
%% Example syntax (mykeygen_seq is not defined)
1014
%% {key_generator, {function, test, mykeygen_seq, [10000, 10, 10, 100]}}.
1115

src/basho_bench_driver_http_raw.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ send_request(Url, Headers, Method, Body, Options, Count) ->
491491
SSLOpts when is_list(SSLOpts) ->
492492
[{is_ssl, true}, {ssl_options, SSLOpts} | Options]
493493
end,
494-
case catch(ibrowse_http_client:send_req(Pid, Url, Headers, Method, Body, Options2, basho_bench_config:get(http_raw_request_timeout, 5000))) of
494+
case catch(ibrowse_http_client:send_req(Pid, Url, Headers ++ basho_bench_config:get(http_raw_append_headers,[]), Method, Body, Options2, basho_bench_config:get(http_raw_request_timeout, 5000))) of
495495
{ok, Status, RespHeaders, RespBody} ->
496496
maybe_disconnect(Url),
497497
{ok, Status, RespHeaders, RespBody};

0 commit comments

Comments
 (0)