aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGustaf Sjoberg <[email protected]>2017-03-22 09:18:43 +0100
committerLoïc Hoguin <[email protected]>2017-05-01 18:24:40 +0200
commit3f0b598edff1f411e31aca18ea96562b0d724257 (patch)
treefa1325e47e931805379aac116ed3065b328d1f58 /test
parent0a181681223aead4043b2437fe493652db6e5f8a (diff)
downloadgun-3f0b598edff1f411e31aca18ea96562b0d724257.tar.gz
gun-3f0b598edff1f411e31aca18ea96562b0d724257.tar.bz2
gun-3f0b598edff1f411e31aca18ea96562b0d724257.zip
Add transform_header_name http option.
Diffstat (limited to 'test')
-rw-r--r--test/gun_SUITE.erl13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/gun_SUITE.erl b/test/gun_SUITE.erl
index 171c874..505f365 100644
--- a/test/gun_SUITE.erl
+++ b/test/gun_SUITE.erl
@@ -139,3 +139,16 @@ retry_timeout(_) ->
after 400 ->
error(gone_too_late)
end.
+
+transform_header_name(_) ->
+ doc("The reply_to option allows using a separate process for requests."),
+ {ok, Pid} = gun:open("google.com", 443, #{
+ protocols => [http],
+ http_opts => #{
+ transform_header_name => fun(<<"host">>) -> <<"HOST">>; (N) -> N end
+ }
+ }),
+ {ok, http} = gun:await_up(Pid),
+ Ref = gun:get(Pid, "/", [{<<"host">>, <<"google.com">>}]),
+ {response, _, _, _} = gun:await(Pid, Ref),
+ ok.