From 0bdcd574c40f456102cdf6d8405a83b9d88af996 Mon Sep 17 00:00:00 2001 From: harshit181 Date: Mon, 9 Feb 2026 16:42:21 +0530 Subject: [PATCH] fix: issue if book href are absolute url and not relative to server (#741) ## Summary fixing issue if book href are absolute url and not relative to the server ## Additional Context * Fixes https://github.com/crosspoint-reader/crosspoint-reader/issues/632 * https://github.com/harshit181/RSSPub/issues/43 --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**< PARTIALLY>**_ --- src/util/UrlUtils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/UrlUtils.cpp b/src/util/UrlUtils.cpp index bbf5ac15..a2156552 100644 --- a/src/util/UrlUtils.cpp +++ b/src/util/UrlUtils.cpp @@ -25,6 +25,10 @@ std::string extractHost(const std::string& url) { } std::string buildUrl(const std::string& serverUrl, const std::string& path) { + // If path is already an absolute URL (has protocol), use it directly + if (path.find("://") != std::string::npos) { + return path; + } const std::string urlWithProtocol = ensureProtocol(serverUrl); if (path.empty()) { return urlWithProtocol;