Skip to content

Commit db5b4d9

Browse files
committed
fix: protocol URL not starting download in some cases
Due to the protocol already containing `://`, some browsers will strip the `:` from the `https://` protocol, causing the URL to not be recognized, meaning the download never starts.
1 parent 884e0d8 commit db5b4d9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

scripts/control_create/control_create.gml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,9 @@ function control_create() {
704704
// Download song
705705
if (protocol_data != pointer_null) {
706706
var download_url = string_replace(protocol_data, "nbs://", "")
707+
download_url = string_replace(download_url, "https//", "https://") // Re-add : stripped from URL
708+
download_url = string_replace(download_url, "http//", "http://")
709+
download_song_start(download_url)
707710
}
708711
// Open song
709712
else if (filename != "") {

scripts/control_http/control_http.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ function control_http() {
22
// control_http()
33
// Handles the check for updates, then attempts to download it if one is available
44

5-
if (song_download_data != -1) {
5+
if (song_download_data != pointer_null) {
66
download_song_from_url()
77
}
88

0 commit comments

Comments
 (0)