Getting ready for HTTPS & HTTP/2

This commit is contained in:
Gaël Métais
2018-04-05 19:16:59 -05:00
parent 52ded23315
commit b972422cc6
6 changed files with 22 additions and 11 deletions
@@ -924,4 +924,15 @@
};
});
// Proxify an HTTP image to HTTPS if hosted on HTTPS
// Uses a great free open-source external service: https://images.weserv.nl
offendersDirectives.filter('https', function() {
return function(url) {
if (url && url.indexOf('http://') === 0 && window.location.protocol === 'https:') {
return 'https://images.weserv.nl/?url=' + encodeURIComponent(url.substr(7));
}
return url;
};
});
})();