aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-06-22 23:20:16 +0900
committerYang Tse <yangsita@gmail.com>2012-06-22 18:58:30 +0200
commit7f59577fddbcef890fb6c3dcb6b1039feb95dde4 (patch)
tree5650e6f74cedadc501afaabccdc32339356315e3
parentb193ba8a02d796b4f9a8bb432c160b4b45052b1d (diff)
Metalink: ignore --include if --metalink is used.
Including headers in response body will break Metalink XML parser. If it is included in the file described in Metalink XML, hash check will fail. Therefore, --include should be ignored if --metalink is used.
-rw-r--r--src/tool_operate.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 3fcdf4781..d944a0093 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -879,7 +879,10 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
my_setopt(curl, CURLOPT_NOBODY, 1);
my_setopt(curl, CURLOPT_HEADER, 1);
}
- else
+ /* If --metalink is used, we ignore --include (headers in
+ output) option because mixing headers to the body will
+ confuse XML parser and/or hash check will fail. */
+ else if(!config->use_metalink)
my_setopt(curl, CURLOPT_HEADER, config->include_headers);
#if !defined(CURL_DISABLE_PROXY)