xtristan commited on
Commit
b36e841
·
verified ·
1 Parent(s): 32fe069

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -154,6 +154,10 @@ def download_track(request: Request, download_request: DownloadRequest):
154
  # Return the download URL
155
  relative_path = quote(str(os.path.relpath(filepath, "downloads")))
156
  base_url = str(request.base_url).rstrip('/')
 
 
 
 
157
  download_url = f"{base_url}/downloads/{relative_path}"
158
  logger.info(f"Download successful: {download_url}")
159
  gc.collect()
 
154
  # Return the download URL
155
  relative_path = quote(str(os.path.relpath(filepath, "downloads")))
156
  base_url = str(request.base_url).rstrip('/')
157
+
158
+ if base_url.startswith("http://"):
159
+ base_url = base_url.replace("http://", "https://", 1)
160
+
161
  download_url = f"{base_url}/downloads/{relative_path}"
162
  logger.info(f"Download successful: {download_url}")
163
  gc.collect()