galaxy-urls-1
authorDebian Games Team <pkg-games-devel@lists.alioth.debian.org>
Sun, 20 Oct 2024 19:39:20 +0000 (21:39 +0200)
committerStephen Kitt <skitt@debian.org>
Sun, 20 Oct 2024 19:39:20 +0000 (21:39 +0200)
commit 52b8bdc8fa0028bcb875c6a723c6e04deeecbcb8
Author: Sude <lgogdownloader@gmail.com>
Date:   Thu Aug 22 18:13:44 2024 +0300

    Fix galaxyAPI::getPathFromDownlinkUrl with Fastly CDN urls

    Fastly CDN urls don't contain query strings

Gbp-Pq: Name galaxy-urls-1.patch

src/galaxyapi.cpp

index 17595e53020cccb3020c7d202ed31808535c8339..46519e4d69d2cd17b7a24a07895bb52a8a47a429 100644 (file)
@@ -518,6 +518,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);