WiP on mailers

This commit is contained in:
Tomas Bures 2018-04-29 18:13:40 +02:00
parent e97415c237
commit a4ee1534cc
46 changed files with 1263 additions and 529 deletions

View file

@ -1,23 +1,23 @@
'use strict';
const config = require('config');
const url = require('url');
const urllib = require('url');
function getTrustedUrl(path) {
return config.www.trustedUrlBase + (path || '');
return urllib.resolve(config.www.trustedUrlBase, path || '');
}
function getSandboxUrl(path) {
return config.www.sandboxUrlBase + (path || '');
return urllib.resolve(config.www.sandboxUrlBase, path || '');
}
function getTrustedUrlBaseDir() {
const mailtrainUrl = url.parse(getTrustedUrl());
const mailtrainUrl = urllib.parse(getTrustedUrl());
return mailtrainUrl.pathname;
}
function getSandboxUrlBaseDir() {
const mailtrainUrl = url.parse(getSandboxUrl());
const mailtrainUrl = urllib.parse(getSandboxUrl());
return mailtrainUrl.pathname;
}