Permalink
Browse files

Merge pull request #69 from nathanaschbacher/master

Updated http_raw driver to allow appending custom headers.
  • Loading branch information...
2 parents f2641a4 + 041b1a7 commit 68bc174e157addea510be3c75ccf1e0f978218fa Scott Lystig Fritchie committed Apr 9, 2013
Showing with 5 additions and 1 deletion.
  1. +4 −0 examples/httpraw.config
  2. +1 −1 src/basho_bench_driver_http_raw.erl
View
@@ -6,6 +6,10 @@
{driver, basho_bench_driver_http_raw}.
+%% Example custom headers. Beware using headers that may cause collisions
+%% with automatically generated headers used by other parts of the driver.
+%% {http_raw_append_headers, [{"Authorization", "Basic dXNlcm5hbWU6cGFzc3dvcmQ="}]}.
+
%% Example syntax (mykeygen_seq is not defined)
%% {key_generator, {function, test, mykeygen_seq, [10000, 10, 10, 100]}}.
@@ -491,7 +491,7 @@ send_request(Url, Headers, Method, Body, Options, Count) ->
SSLOpts when is_list(SSLOpts) ->
[{is_ssl, true}, {ssl_options, SSLOpts} | Options]
end,
- case catch(ibrowse_http_client:send_req(Pid, Url, Headers, Method, Body, Options2, basho_bench_config:get(http_raw_request_timeout, 5000))) of
+ 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
{ok, Status, RespHeaders, RespBody} ->
maybe_disconnect(Url),
{ok, Status, RespHeaders, RespBody};

0 comments on commit 68bc174

Please sign in to comment.