#include "update_check.h" #include "http_head.h" namespace roro::release { bool trustedAssetUrl(const std::string& url, const std::string& host, const std::string& repo) { Url u = parseUrl(url); if (!u.ok || !u.https || u.port != 443 || u.host != host) return false; std::string prefix = "/" + repo + "/releases/download/"; return u.path.compare(0, prefix.size(), prefix) == 0 && u.path.find("..") == std::string::npos && u.path.find('?') == std::string::npos && u.path.find('#') == std::string::npos; } } // namespace roro::release