make dpd.js https aware

This commit is contained in:
Carsten Milling
2013-03-16 21:50:00 +01:00
committed by Jeff Cross
parent 6b2e505d80
commit 6299d39bc9
2 changed files with 4 additions and 4 deletions

View File

@@ -2,7 +2,10 @@
if (!window._dpd) window._dpd = {};
var root = window.location.origin;
var root = window.location.protocol + '//' + window.location.hostname;
if (window.location.port !== '') {
root += ':' + window.location.port;
}
var consoleLog = (typeof console !== 'undefined') && console.log;

View File

@@ -39,9 +39,6 @@ ClientLib.prototype.handle = function (ctx, next) {
ctx.res.setHeader('Content-Type', 'text/javascript');
var lib = resource.clientLib;
var host = ctx.req.headers.host;
if (lib) lib = lib.replace('var root = window.location.origin;', 'var root = "http://' + host + '";');
ctx.res.write(lib);
resource.generate(ctx.res, function() {
ctx.res.end();