mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
using concat instead of push
This commit is contained in:
parent
c88b715c30
commit
33d891d7ac
@ -122,13 +122,13 @@ class AwsProvider {
|
||||
|| process.env.HTTPS_CA
|
||||
|| process.env.https_ca;
|
||||
|
||||
const caCerts = [];
|
||||
var caCerts = [];
|
||||
|
||||
if (ca) {
|
||||
// Can be a single certificate or multiple, comma separated.
|
||||
const caArr = ca.split(',');
|
||||
// Replace the newline -- https://stackoverflow.com/questions/30400341
|
||||
caCerts = caArr.map(cert => cert.replace(/\\n/g, '\n'));
|
||||
caCerts = caCerts.concat(caArr.map(cert => cert.replace(/\\n/g, '\n')));
|
||||
}
|
||||
|
||||
const cafile = process.env.cafile
|
||||
@ -138,7 +138,7 @@ class AwsProvider {
|
||||
if (cafile) {
|
||||
// Can be a single certificate file path or multiple paths, comma separated.
|
||||
const caPathArr = cafile.split(',');
|
||||
caCerts.push(caPathArr.map(cafilePath => caCerts.push(fs.readFileSync(cafilePath.trim()))));
|
||||
caCerts = caCerts.concat(caPathArr.map(cafilePath => fs.readFileSync(cafilePath.trim())));
|
||||
}
|
||||
|
||||
if (caCerts.length > 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user