Skip to content

Commit 62a875b

Browse files
committed
Fix variable name for download https error
#2161
1 parent bb23a18 commit 62a875b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/services/tools.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ export const getSecureUrl = async (mediaUrl: string) => {
1212
method: 'POST',
1313
body: { url: mediaUrl }
1414
})
15-
15+
1616
const secureUrlInfo = response?.data || {}
1717
const { secureUrl } = secureUrlInfo
18-
18+
1919
if (secureUrl?.startsWith('https://')) {
2020
finalUrl = secureUrl
2121
}
@@ -48,8 +48,8 @@ export const getSecureUrl = async (mediaUrl: string) => {
4848
Sometimes the final redirected URL will begin with http. Change it to https
4949
to avoid "cleartext not allowed" errors on Android.
5050
*/
51-
if (mediaUrl.indexOf('http://') >= 0) {
52-
finalUrl = mediaUrl.replace(/http:\/\//g, 'https://')
51+
if (finalUrl.indexOf('http://') >= 0) {
52+
finalUrl = finalUrl.replace(/http:\/\//g, 'https://')
5353
}
5454
}
5555
}

0 commit comments

Comments
 (0)