Load libraries from same protocl as page was served from

This commit is contained in:
perroned 2015-10-06 12:48:34 -07:00
parent 9f69fc4105
commit 3a738caa90

View File

@ -6,7 +6,10 @@ loadLib = (libname) ->
#Meteor.log.info "Failed to load library", param
console.log "Failed to load library", param
Meteor.Loader.loadJs("https://#{window.location.hostname}/client/lib/#{libname}", successCallback, 10000).fail(retryMessageCallback)
protocol = "http"
if window.location.origin.match(/^https/)
protocol = "https"
Meteor.Loader.loadJs("#{protocol}://#{window.location.hostname}/client/lib/#{libname}", successCallback, 10000).fail(retryMessageCallback)
# These settings can just be stored locally in session, created at start up
Meteor.startup ->