summaryrefslogtreecommitdiff
path: root/src/tool_operate.c
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2016-05-01 16:07:04 -0400
committerJay Satiro <raysatiro@yahoo.com>2016-05-01 16:07:04 -0400
commitb9728bca549709a26a5228f1d44f7488dd26811d (patch)
tree1bbc3d0aa4872f05299c22de7d3d319270384f2b /src/tool_operate.c
parent283babfaf8d8f3bab9d3c63cea94eb0b84e79c37 (diff)
downloadcurl-b9728bca549709a26a5228f1d44f7488dd26811d.tar.gz
tool_cb_hdr: Fix --remote-header-name with schemeless URL
- Move the existing scheme check from tool_operate. In the case of --remote-header-name we want to parse Content-disposition for a filename, but only if the scheme is http or https. A recent adjustment 0dc4d8e was made to account for schemeless URLs however it's not 100% accurate. To remedy that I've moved the scheme check to the header callback, since at that point the library has already determined the scheme. Bug: https://github.com/curl/curl/issues/760 Reported-by: Kai Noda
Diffstat (limited to 'src/tool_operate.c')
-rw-r--r--src/tool_operate.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index ab29c00b3..5f49efb71 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -1295,12 +1295,7 @@ static CURLcode operate_do(struct GlobalConfig *global,
my_setopt_flags(curl, CURLOPT_REDIR_PROTOCOLS, config->proto_redir);
if(config->content_disposition
- && (urlnode->flags & GETOUT_USEREMOTE)
- && (checkprefix("http://", this_url) ||
- checkprefix("https://", this_url) ||
- (!strstr(this_url, "://") &&
- (!config->proto_default ||
- checkprefix("http", config->proto_default)))))
+ && (urlnode->flags & GETOUT_USEREMOTE))
hdrcbdata.honor_cd_filename = TRUE;
else
hdrcbdata.honor_cd_filename = FALSE;