summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2018-04-20 16:10:04 -0700
committerGitHub <noreply@github.com>2018-04-20 16:10:04 -0700
commit39b743b36a13f63ccc4b9cd17594be070528d180 (patch)
treed10caf1a76711170ed56737af66d8558fe0f5baf /test
parentd83167c74c15820f0f9a7513044faaecac533267 (diff)
parent088c47ad1d1f23650dc7bdc3d10659b9a223abb8 (diff)
Merge pull request #1756 from ferd/handle-schemeless-proxy
Handle Schema-less Proxy URLs in ENV vars
Diffstat (limited to 'test')
-rw-r--r--test/rebar_utils_SUITE.erl14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/rebar_utils_SUITE.erl b/test/rebar_utils_SUITE.erl
index 8b8769b..e4a5bd3 100644
--- a/test/rebar_utils_SUITE.erl
+++ b/test/rebar_utils_SUITE.erl
@@ -275,11 +275,13 @@ tup_merge(_Config) ->
)
).
-proxy_auth(_Config) ->
- proxy_auth(_Config, "http_proxy"),
- proxy_auth(_Config, "https_proxy").
+proxy_auth(Config) ->
+ proxy_auth(Config, "http://", "http_proxy"),
+ proxy_auth(Config, "https://", "https_proxy"),
+ proxy_auth(Config, "", "http_proxy"),
+ proxy_auth(Config, "", "https_proxy").
-proxy_auth(_Config, ProxyEnvKey) ->
+proxy_auth(_Config, Schema, ProxyEnvKey) ->
Host = "host:",
Port = "1234",
@@ -291,13 +293,13 @@ proxy_auth(_Config, ProxyEnvKey) ->
?assertEqual([], rebar_utils:get_proxy_auth()),
%% proxy auth with regular username/password
- os:putenv(ProxyEnvKey, "http://Username:Password@" ++ Host ++ Port),
+ os:putenv(ProxyEnvKey, Schema++"Username:Password@" ++ Host ++ Port),
rebar_utils:set_httpc_options(),
?assertEqual([{proxy_auth, {"Username", "Password"}}],
rebar_utils:get_proxy_auth()),
%% proxy auth with username missing and url encoded password
- os:putenv(ProxyEnvKey, "http://:%3F!abc%23%24@" ++ Host ++ Port),
+ os:putenv(ProxyEnvKey, Schema++":%3F!abc%23%24@" ++ Host ++ Port),
rebar_utils:set_httpc_options(),
?assertEqual([{proxy_auth, {"", "?!abc#$"}}],
rebar_utils:get_proxy_auth()),