From c90ea518c5063e57b1c390b2f9fd696811468a91 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 10 Apr 2023 21:17:49 +0200 Subject: [PATCH] FeedReader: Fixed embedding of images with https --- plugins/FeedReader/services/p3FeedReaderThread.cc | 6 +++--- plugins/FeedReader/util/CURLWrapper.cpp | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/FeedReader/services/p3FeedReaderThread.cc b/plugins/FeedReader/services/p3FeedReaderThread.cc index 38f966663..45c869581 100644 --- a/plugins/FeedReader/services/p3FeedReaderThread.cc +++ b/plugins/FeedReader/services/p3FeedReaderThread.cc @@ -196,7 +196,7 @@ static std::string getBaseLink(std::string link) static std::string calculateLink(const std::string &baseLink, const std::string &link) { - if (link.substr(0, 7) == "http://") { + if (link.substr(0, 7) == "http://" || link.substr(0, 8) == "https://") { /* absolute link */ return link; } @@ -204,8 +204,8 @@ static std::string calculateLink(const std::string &baseLink, const std::string /* calculate link of base link */ std::string resultLink = baseLink; - /* link should begin with "http://" */ - if (resultLink.substr(0, 7) != "http://") { + /* link should begin with "http://" or "https://" */ + if (resultLink.substr(0, 7) != "http://" || resultLink.substr(0, 8) != "https://") { resultLink.insert(0, "http://"); } diff --git a/plugins/FeedReader/util/CURLWrapper.cpp b/plugins/FeedReader/util/CURLWrapper.cpp index 4e8c5c9bb..87fd986ff 100644 --- a/plugins/FeedReader/util/CURLWrapper.cpp +++ b/plugins/FeedReader/util/CURLWrapper.cpp @@ -94,6 +94,7 @@ CURLcode CURLWrapper::downloadBinary(const std::string &link, std::vector