Permalink
Browse files

Ensure API call is to SSL protocol if appropriate.

  • Loading branch information...
1 parent e914d99 commit 2f9ba9d97b19894e74e0e09d3fba1bffc68f7d4b @ahume ahume committed Nov 9, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/fontdeck/fontdeck_script.js
View
5 src/fontdeck/fontdeck_script.js
@@ -12,11 +12,12 @@ webfont.FontdeckScript = function(global, domHelper, configuration) {
webfont.FontdeckScript.NAME = 'fontdeck';
webfont.FontdeckScript.HOOK = '__webfontfontdeckmodule__';
-webfont.FontdeckScript.API = 'http://f.fontdeck.com/s/css/js/';
+webfont.FontdeckScript.API = '//f.fontdeck.com/s/css/js/';
webfont.FontdeckScript.prototype.getScriptSrc = function(projectId) {
+ var protocol = 'https:' == window.location.protocol ? 'https:' : 'http:';
var api = this.configuration_['api'] || webfont.FontdeckScript.API;
- return api + document.location.hostname + '/' + projectId + '.js';
+ return protocol + api + document.location.hostname + '/' + projectId + '.js';
};
webfont.FontdeckScript.prototype.supportUserAgent = function(userAgent, support) {

0 comments on commit 2f9ba9d

Please sign in to comment.