a4305926f0e89a8af454e34709174f7ea07fb5bb
galt
  Thu Mar 6 00:41:37 2025 -0800
Add support for DropBox for hubs and customtracks using byteranges. fixes #35342

diff --git src/lib/udc.c src/lib/udc.c
index 7ef70c098e3..a79c07c7ecb 100644
--- src/lib/udc.c
+++ src/lib/udc.c
@@ -730,30 +730,37 @@
     ++redirectCount;
     if (redirectCount > 5)
 	{
 	warn("code %d redirects: exceeded limit of 5 redirects, %s", status, url);
 	return FALSE;
 	}
 
     char *newUrl = hashFindValUpperCase(hash, "Location:");
 
      if (!newUrl)
 	{
 	warn("code %d redirects: redirect location missing, %s", status, url);
 	return FALSE;
 	}
 
+    // removing any hashkey from redirect location
+    char *hashKey = strchr(newUrl, '#');  // truncate at hashkey
+    if (hashKey)
+	{
+	*hashKey = 0;
+	}
+
     // path may be relative
     if (hasProtocol(newUrl))
 	{
         newUrl = cloneString(newUrl);
 	}
     else
 	{
 	newUrl = expandUrlOnBase(url, newUrl);
 	}
 
     retInfo->ci.redirUrl = newUrl;
     url = transferParamsToRedirectedUrl(url, newUrl);		
     hashFree(&hash);
     }