Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
srcToHttps: function (src) {
if (!src) {
return null;
}
if (src.indexOf('https') != -1) {
return src;
}
if (src.indexOf('http://cs') != -1) {
return "https://pp.vk.me/c" + src.replace("http://cs", "").replace(".vk.me", "");
} else {
return src.replace('http', 'https');
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment