diff options
author | Zack Galbreath <zack.galbreath@kitware.com> | 2023-09-07 16:12:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-10-12 19:53:10 (GMT) |
commit | ce661c43996211f146096186ac9bec9733f498c0 (patch) | |
tree | 082c246e3021493fc6f2fb9664469f5f276aa47d | |
parent | 091005fa657cd64a78656ff874032effdf433776 (diff) | |
download | CMake-ce661c43996211f146096186ac9bec9733f498c0.zip CMake-ce661c43996211f146096186ac9bec9733f498c0.tar.gz CMake-ce661c43996211f146096186ac9bec9733f498c0.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.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 9161515..6ecf36f 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -308,6 +308,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); |