From 58e82ef9e865c9547c04b415d30f8b89e0811666 Mon Sep 17 00:00:00 2001 From: badaix Date: Thu, 9 Jan 2025 10:19:32 +0100 Subject: [PATCH] Provide cover art over HTTPS --- server/streamreader/pcm_stream.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/streamreader/pcm_stream.cpp b/server/streamreader/pcm_stream.cpp index 2ddcb0ff..9a718b8d 100644 --- a/server/streamreader/pcm_stream.cpp +++ b/server/streamreader/pcm_stream.cpp @@ -543,12 +543,20 @@ void PcmStream::setProperties(const Properties& properties) std::stringstream url; if (server_settings_.http.url_prefix.empty()) { - url << "http://" << server_settings_.http.host << ":" << server_settings_.http.port << "/__image_cache?name=" << md5; + std::string proto{"http"}; + size_t port{server_settings_.http.port}; + if (server_settings_.http.ssl_enabled) + { + proto = "https"; + port = server_settings_.http.ssl_port; + } + url << proto << "://" << server_settings_.http.host << ":" << port; } else { - url << server_settings_.http.url_prefix << "/__image_cache?name=" << md5; + url << server_settings_.http.url_prefix; } + url << "/__image_cache?name=" << md5; props.metadata->art_url = url.str(); } else if (!props.metadata.has_value() || !props.metadata->art_data.has_value())