From 52b8bdc8fa0028bcb875c6a723c6e04deeecbcb8 Mon Sep 17 00:00:00 2001 From: Sude Date: Thu, 22 Aug 2024 18:13:44 +0300 Subject: [PATCH] Fix galaxyAPI::getPathFromDownlinkUrl with Fastly CDN urls Fastly CDN urls don't contain query strings --- src/galaxyapi.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/galaxyapi.cpp b/src/galaxyapi.cpp index 56d5745..7699d69 100644 --- a/src/galaxyapi.cpp +++ b/src/galaxyapi.cpp @@ -567,6 +567,11 @@ std::string galaxyAPI::getPathFromDownlinkUrl(const std::string& downlink_url, c else filename_end_pos = downlink_url_unescaped.find_first_of("?"); + // Downlink doesn't contain "?path=" or "?" + // Set end pos to length + if (filename_end_pos == std::string::npos) + filename_end_pos = downlink_url_unescaped.length(); + if (downlink_url_unescaped.find("/" + gamename + "/") != std::string::npos) { path.assign(downlink_url_unescaped.begin()+downlink_url_unescaped.find("/" + gamename + "/"), downlink_url_unescaped.begin()+filename_end_pos);