summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tool_cfgable.h1
-rw-r--r--src/tool_getparam.c7
-rw-r--r--src/tool_help.c4
-rw-r--r--src/tool_operate.c2
4 files changed, 12 insertions, 2 deletions
diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h
index 38777f6fd..a0ebcad59 100644
--- a/src/tool_cfgable.h
+++ b/src/tool_cfgable.h
@@ -138,6 +138,7 @@ struct OperationConfig {
bool readbusy; /* set when reading input returns EAGAIN */
bool globoff;
bool use_httpget;
+ bool strip_path_slash;
bool insecure_ok; /* set TRUE to allow insecure SSL connects */
bool proxy_insecure_ok; /* set TRUE to allow insecure SSL connects
for proxy */
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index fabe8f04b..b708633e8 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -257,6 +257,7 @@ static const struct LongShort aliases[]= {
{"Fs", "form-string", ARG_STRING},
{"g", "globoff", ARG_BOOL},
{"G", "get", ARG_NONE},
+ {"Ga", "strip-path-slash", ARG_BOOL},
{"h", "help", ARG_BOOL},
{"H", "header", ARG_STRING},
{"Hp", "proxy-header", ARG_STRING},
@@ -1591,7 +1592,11 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
break;
case 'G': /* HTTP GET */
- config->use_httpget = TRUE;
+ if(subletter == 'a') { /* --strip-path-slash */
+ config->strip_path_slash = TRUE;
+ }
+ else
+ config->use_httpget = TRUE;
break;
case 'h': /* h for help */
diff --git a/src/tool_help.c b/src/tool_help.c
index 46aae4527..6d36e550f 100644
--- a/src/tool_help.c
+++ b/src/tool_help.c
@@ -252,7 +252,7 @@ static const struct helptxt helptext[] = {
"Use HTTP NTLM authentication"},
{" --ntlm-wb",
"Use HTTP NTLM authentication with winbind"},
- {" --oauth2-bearer",
+ {" --oauth2-bearer <token>",
"OAuth 2 Bearer Token"},
{"-o, --output <file>",
"Write to file instead of stdout"},
@@ -400,6 +400,8 @@ static const struct helptxt helptext[] = {
"Use SSLv3"},
{" --stderr",
"Where to redirect stderr"},
+ {" --strip-path-slash",
+ "Strip off the first slash of the path"},
{" --suppress-connect-headers",
"Suppress proxy CONNECT response headers"},
{" --tcp-fastopen",
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 6f1525e8b..244c7794b 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -969,6 +969,8 @@ static CURLcode operate_do(struct GlobalConfig *global,
#endif /* !CURL_DISABLE_PROXY */
my_setopt(curl, CURLOPT_FAILONERROR, config->failonerror?1L:0L);
+ my_setopt(curl, CURLOPT_STRIP_PATH_SLASH,
+ config->strip_path_slash?1L:0L);
my_setopt(curl, CURLOPT_UPLOAD, uploadfile?1L:0L);
my_setopt(curl, CURLOPT_DIRLISTONLY, config->dirlistonly?1L:0L);
my_setopt(curl, CURLOPT_APPEND, config->ftp_append?1L:0L);