kopia lustrzana https://github.com/c9/core
Make profile client multi-domain aware
rodzic
9eeccd6d05
commit
aaeceb921f
|
@ -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(/\/.*/, "")
|
||||
|
|
Ładowanie…
Reference in New Issue