Skip to content

Commit

Permalink
core: only use http redirects
Browse files Browse the repository at this point in the history
This is an attempt to prevent cURL from being redirected from http to
https since we ship without SSL in MAVSDK v2.
  • Loading branch information
julianoes committed Dec 15, 2024
1 parent a964028 commit 1ccee5c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mavsdk/core/curl_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ bool CurlWrapper::download_text(const std::string& url, std::string& content)
curl_easy_setopt(curl.get(), CURLOPT_URL, url.c_str());
curl_easy_setopt(curl.get(), CURLOPT_WRITEFUNCTION, write_callback);
curl_easy_setopt(curl.get(), CURLOPT_WRITEDATA, &readBuffer);
curl_easy_setopt(curl.get(), CURLOPT_REDIR_PROTOCOLS_STR, "http");
res = curl_easy_perform(curl.get());
content = readBuffer;

Expand Down Expand Up @@ -108,6 +109,7 @@ bool CurlWrapper::download_file_to_path(
curl_easy_setopt(curl.get(), CURLOPT_WRITEFUNCTION, NULL);
curl_easy_setopt(curl.get(), CURLOPT_WRITEDATA, fp);
curl_easy_setopt(curl.get(), CURLOPT_NOPROGRESS, 0L);
curl_easy_setopt(curl.get(), CURLOPT_REDIR_PROTOCOLS_STR, "http");
res = curl_easy_perform(curl.get());
fclose(fp);

Expand Down

0 comments on commit 1ccee5c

Please sign in to comment.