mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 14:24:24 +00:00
feat(blockchainConfig): enable having auto cors plus other origins
This commit is contained in:
parent
540ff751a9
commit
9e349ff267
@ -163,13 +163,15 @@ Config.prototype._updateBlockchainCors = function(){
|
||||
corsParts.push(constants.embarkResourceOrigin);
|
||||
|
||||
let cors = corsParts.join(',');
|
||||
if(blockchainConfig.rpcCorsDomain === 'auto'){
|
||||
if(cors.length) blockchainConfig.rpcCorsDomain = cors;
|
||||
else blockchainConfig.rpcCorsDomain = '';
|
||||
if (blockchainConfig.rpcCorsDomain === 'auto') {
|
||||
blockchainConfig.rpcCorsDomain = cors;
|
||||
} else if (blockchainConfig.rpcCorsDomain.indexOf('auto') > -1) {
|
||||
blockchainConfig.rpcCorsDomain = blockchainConfig.rpcCorsDomain.replace('auto', cors);
|
||||
}
|
||||
if(blockchainConfig.wsOrigins === 'auto'){
|
||||
if(cors.length) blockchainConfig.wsOrigins = cors;
|
||||
else blockchainConfig.wsOrigins = '';
|
||||
if (blockchainConfig.wsOrigins === 'auto') {
|
||||
blockchainConfig.wsOrigins = cors;
|
||||
} else if (blockchainConfig.wsOrigins.indexOf('auto') > -1) {
|
||||
blockchainConfig.wsOrigins = blockchainConfig.wsOrigins.replace('auto', cors);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user