Skip to content

Commit

Permalink
Merge pull request #2471 from mavlink/pr-v2-https-workaround
Browse files Browse the repository at this point in the history
[v2 only] core: use http instead of https
  • Loading branch information
julianoes authored Dec 12, 2024
2 parents f3a6d6d + 6f8d122 commit a964028
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/mavsdk/core/http_loader.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "http_loader.h"
#include "curl_wrapper.h"
#include "log.h"

namespace mavsdk {

Expand Down Expand Up @@ -86,7 +87,17 @@ bool HttpLoader::do_download(

bool HttpLoader::download_text_sync(const std::string& url, std::string& content)
{
bool success = _curl_wrapper->download_text(url, content);
std::string http_url(url);

// We don't have https support in curl, so we try to use http for now.

std::string https = "https";
if (http_url.find(https, 0) == 0) {
http_url.replace(0, https.size(), "http");
LogWarn() << "Downloading over http instead of https";
}

bool success = _curl_wrapper->download_text(http_url, content);
return success;
}

Expand Down

0 comments on commit a964028

Please sign in to comment.