aboutsummaryrefslogtreecommitdiff
path: root/src/tool_operate.c
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2018-02-25 20:17:25 +0100
committerDaniel Stenberg <daniel@haxx.se>2018-05-31 11:27:16 +0200
commit946ce5b61fc3832935ea92b4388116c7f637fb8c (patch)
tree3d4ef97037f869fdccb509940e35c972d476ee82 /src/tool_operate.c
parent71d35e4a1d96011076d3e81cad4e7b417d9a3985 (diff)
downloadgnurl-946ce5b61fc3832935ea92b4388116c7f637fb8c.tar.gz
gnurl-946ce5b61fc3832935ea92b4388116c7f637fb8c.tar.bz2
gnurl-946ce5b61fc3832935ea92b4388116c7f637fb8c.zip
option: disallow username in URL
Adds CURLOPT_DISALLOW_USERNAME_IN_URL and --disallow-username-in-url. Makes libcurl reject URLs with a username in them. Closes #2340
Diffstat (limited to 'src/tool_operate.c')
-rw-r--r--src/tool_operate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 0a1b1a48d..26fc251f5 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -1474,6 +1474,9 @@ static CURLcode operate_do(struct GlobalConfig *global,
if(config->haproxy_protocol)
my_setopt(curl, CURLOPT_HAPROXYPROTOCOL, 1L);
+ if(config->disallow_username_in_url)
+ my_setopt(curl, CURLOPT_DISALLOW_USERNAME_IN_URL, 1L);
+
/* initialize retry vars for loop below */
retry_sleep_default = (config->retry_delay) ?
config->retry_delay*1000L : RETRY_SLEEP_DEFAULT; /* ms */