Make profile client multi-domain aware

pull/117/merge
Lennart kats 2015-06-29 11:06:43 +00:00
rodzic 9eeccd6d05
commit aaeceb921f
1 zmienionych plików z 4 dodań i 1 usunięć

5
node_modules/c9/urls.js wygenerowano vendored
Wyświetl plik

@ -30,7 +30,10 @@ function main(options, imports, register) {
* @param {String} [targetBaseUrlPattern] The target URL pattern, e.g. https://$DOMAIN
*/
plugin.getBaseUrl = function(req, sourceBaseUrlPattern, targetBaseUrlPattern) {
var sourceHost = req.headers && req.headers.host || req.host || req;
var sourceHost = req.headers && req.headers.host
|| req.host
|| req.url && req.url.replace(/^https?:\/\/([^/]*).*/, "$1")
|| req;
var sourceHostMatcher = sourceBaseUrlPattern
.replace(/^https?:\/\//, "")
.replace(/\/.*/, "")