We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb23a18 commit 62a875bCopy full SHA for 62a875b
src/services/tools.ts
@@ -12,10 +12,10 @@ export const getSecureUrl = async (mediaUrl: string) => {
12
method: 'POST',
13
body: { url: mediaUrl }
14
})
15
-
+
16
const secureUrlInfo = response?.data || {}
17
const { secureUrl } = secureUrlInfo
18
19
if (secureUrl?.startsWith('https://')) {
20
finalUrl = secureUrl
21
}
@@ -48,8 +48,8 @@ export const getSecureUrl = async (mediaUrl: string) => {
48
Sometimes the final redirected URL will begin with http. Change it to https
49
to avoid "cleartext not allowed" errors on Android.
50
*/
51
- if (mediaUrl.indexOf('http://') >= 0) {
52
- finalUrl = mediaUrl.replace(/http:\/\//g, 'https://')
+ if (finalUrl.indexOf('http://') >= 0) {
+ finalUrl = finalUrl.replace(/http:\/\//g, 'https://')
53
54
55
0 commit comments