summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZack Galbreath <zack.galbreath@kitware.com>2023-09-07 16:12:30 (GMT)
committerBrad King <brad.king@kitware.com>2023-09-07 19:37:27 (GMT)
commit26ce8dc290710ddbad49335f36968d850176b634 (patch)
tree34aee0dab6a9153c4696ae70b0b1c105cc71644b
parentd63f0be8fcff7b0ea7a06e6d0fe194d5341d8121 (diff)
downloadCMake-26ce8dc290710ddbad49335f36968d850176b634.zip
CMake-26ce8dc290710ddbad49335f36968d850176b634.tar.gz
CMake-26ce8dc290710ddbad49335f36968d850176b634.tar.bz2
ctest: Restore support for http redirects during Submit step
After CDash PR 1519 introduced HTTP status codes greater than 200 for various error cases, CMake commit b7c871f745 (ctest: Update ctest_submit for CDash behavior change, 2023-07-24, v3.27.1~3^2) modified CTest's submit handler to check the status returned by CDash and throw an error when this status is not equal to 200. That change had the unintended side effect of causing CTest submissions to fail when uploading results to a URL that returns a redirect status code (3xx). Fix this by configuring cURL to follow the redirect. The status cURL reports to CTest is now 200 instead of 3xx when CDash is located behind a redirect. Fixes: #25159
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 7d4b0a8..c04f23a 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -309,6 +309,9 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
// specify target
::curl_easy_setopt(curl, CURLOPT_URL, upload_as.c_str());
+ // follow redirects
+ ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
+
// CURLAUTH_BASIC is default, and here we allow additional methods,
// including more secure ones
::curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);