diff options
author | Brad King <brad.king@kitware.com> | 2024-08-15 13:36:28 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-08-15 13:37:00 (GMT) |
commit | d060b05217707bca75b4c1fb19f81f5f9c01628e (patch) | |
tree | 1196ca586859773a02ee99ba713d6d03f0dd8302 /Source | |
parent | 67e14b19bc68c6c36b81fc1ee8d5a944206e3c7d (diff) | |
parent | 1a74f95656e9c66632ff9f5cc18b027852311340 (diff) | |
download | CMake-d060b05217707bca75b4c1fb19f81f5f9c01628e.zip CMake-d060b05217707bca75b4c1fb19f81f5f9c01628e.tar.gz CMake-d060b05217707bca75b4c1fb19f81f5f9c01628e.tar.bz2 |
Merge topic 'macos-curl-user-agent'
1a74f95656 file(DOWNLOAD): Fix User-Agent to use run-time curl version
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9726
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFileCommand.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 926da86..f5cd6e8 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2182,7 +2182,10 @@ bool HandleDownloadCommand(std::vector<std::string> const& args, res = ::curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1); check_curl_result(res, "DOWNLOAD cannot set http failure option: "); - res = ::curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/" LIBCURL_VERSION); + curl_version_info_data* cv = curl_version_info(CURLVERSION_FIRST); + res = ::curl_easy_setopt( + curl, CURLOPT_USERAGENT, + cmStrCat("curl/", cv ? cv->version : LIBCURL_VERSION).c_str()); check_curl_result(res, "DOWNLOAD cannot set user agent option: "); res = ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cmWriteToFileCallback); |