From: Tatsuhiro Tsujikawa Date: Fri, 22 Jun 2012 14:20:16 +0000 (+0900) Subject: Metalink: ignore --include if --metalink is used. X-Git-Tag: curl-7_27_0~138 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7f59577fddbcef890fb6c3dcb6b1039feb95dde4;p=thirdparty%2Fcurl.git 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. --- diff --git a/src/tool_operate.c b/src/tool_operate.c index 3fcdf4781e..d944a00937 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)