Compare commits

...

24 Commits

Author SHA1 Message Date
Bertrand Demiddelaer 277a7cae1e morning hope 2019-01-31 09:21:11 +01:00
Bertrand Demiddelaer 25d15c0240 last test 2019-01-30 18:48:33 +01:00
Bertrand Demiddelaer 16db5494a8 fix 2019-01-30 18:11:04 +01:00
Bertrand Demiddelaer ce3827255f fix 2019-01-30 18:05:49 +01:00
Bertrand Demiddelaer 9ac67707a7 try 2019-01-30 17:52:00 +01:00
Bertrand Demiddelaer 2dc0ab2ae2 fix 2019-01-30 17:41:09 +01:00
Bertrand Demiddelaer ccedd0ad34 test 2019-01-30 17:36:54 +01:00
Bertrand Demiddelaer 0d98ce617e test 2019-01-30 17:29:08 +01:00
Bertrand Demiddelaer 3a74fc3b0c fix 2019-01-30 16:49:54 +01:00
Bertrand Demiddelaer dc9ef1a4a9 try 2019-01-30 16:31:39 +01:00
Bertrand Demiddelaer 6e96b34c37 fix 2019-01-30 16:17:38 +01:00
Bertrand Demiddelaer ac82e69b16 fix 2019-01-30 16:01:52 +01:00
Bertrand Demiddelaer e7fef1f41b fix 2019-01-30 15:45:03 +01:00
Bertrand Demiddelaer b0029ad64f fix 2019-01-30 15:33:45 +01:00
Bertrand Demiddelaer 735c529143 fix 2019-01-30 15:24:20 +01:00
Bertrand Demiddelaer c4f1d787ac fix 2019-01-30 15:14:25 +01:00
Bertrand Demiddelaer e1db4f7666 fixes 2019-01-30 15:06:18 +01:00
Bertrand Demiddelaer 06b35e8d2d better 2019-01-30 14:58:58 +01:00
Bertrand Demiddelaer 677292b17b fix 2019-01-30 11:50:29 +01:00
Bertrand Demiddelaer 5bb1dbf3c9 fix 2019-01-30 11:45:38 +01:00
Bertrand Demiddelaer ca0f0a1faa fix 2019-01-30 11:41:08 +01:00
Bertrand Demiddelaer e75dafff52 fix ? 2019-01-30 11:33:26 +01:00
Bertrand Demiddelaer 58c0c05995 fix attempt for http/https default options 2019-01-30 11:17:00 +01:00
Bertrand Demiddelaer 4ae75cff4f fix attempt 2019-01-30 10:43:37 +01:00
3 changed files with 33 additions and 8 deletions

View File

@ -1,3 +1,8 @@
delete process.env.HTTP_PROXY;
delete process.env.HTTPS_PROXY;
delete process.env.http_proxy;
delete process.env.https_proxy;
const assert = require('assert'); const assert = require('assert');
const { BackendInfo } = require('../../../lib/api/apiUtils/object/BackendInfo'); const { BackendInfo } = require('../../../lib/api/apiUtils/object/BackendInfo');
const { DummyRequestLogger } = require('../helpers'); const { DummyRequestLogger } = require('../helpers');

View File

@ -1,3 +1,8 @@
delete process.env.HTTP_PROXY;
delete process.env.HTTPS_PROXY;
delete process.env.http_proxy;
delete process.env.https_proxy;
const assert = require('assert'); const assert = require('assert');
const parseLC = require('../../../lib/data/locationConstraintParser'); const parseLC = require('../../../lib/data/locationConstraintParser');
const AwsClient = require('../../../lib/data/external/AwsClient'); const AwsClient = require('../../../lib/data/external/AwsClient');
@ -26,10 +31,12 @@ describe('locationConstraintParser', () => {
assert.notStrictEqual(client, undefined); assert.notStrictEqual(client, undefined);
assert(client instanceof AwsClient); assert(client instanceof AwsClient);
assert.strictEqual(client._s3Params.sslEnabled, true); assert.strictEqual(client._s3Params.sslEnabled, true);
assert.strictEqual(client._s3Params.httpOptions.agent.protocol, if (client._s3Params.httpOptions.agent) {
'https:'); assert.strictEqual(client._s3Params.httpOptions.agent.protocol,
assert.strictEqual(client._s3Params.httpOptions.agent.keepAlive, false); 'https:');
assert.strictEqual(client._s3Params.signatureVersion, 'v4'); assert.strictEqual(client._s3Params.httpOptions.agent.keepAlive, false);
}
assert.strictEqual(client._s3Params.signatureVersion, 'v4');
}); });
it('should set correct options for http aws_s3 type location', () => { it('should set correct options for http aws_s3 type location', () => {
@ -37,9 +44,11 @@ describe('locationConstraintParser', () => {
assert.notStrictEqual(client, undefined); assert.notStrictEqual(client, undefined);
assert(client instanceof AwsClient); assert(client instanceof AwsClient);
assert.strictEqual(client._s3Params.sslEnabled, false); assert.strictEqual(client._s3Params.sslEnabled, false);
assert.strictEqual(client._s3Params.httpOptions.agent.protocol, if (client._s3Params.httpOptions.agent) {
'http:'); assert.strictEqual(client._s3Params.httpOptions.agent.protocol,
assert.strictEqual(client._s3Params.httpOptions.agent.keepAlive, false); 'http:');
assert.strictEqual(client._s3Params.signatureVersion, 'v2'); assert.strictEqual(client._s3Params.httpOptions.agent.keepAlive, false);
}
assert.strictEqual(client._s3Params.signatureVersion, 'v2');
}); });
}); });

View File

@ -8,6 +8,13 @@ const certPath = `${basePath}/cert.txt`;
process.env.S3_CONFIG_FILE = `${basePath}/config.json`; process.env.S3_CONFIG_FILE = `${basePath}/config.json`;
const { ConfigObject } = require('../../../../lib/Config'); const { ConfigObject } = require('../../../../lib/Config');
const originalEnv = Object.assign({}, process.env);
delete process.env.HTTP_PROXY;
delete process.env.HTTPS_PROXY;
delete process.env.http_proxy;
delete process.env.https_proxy;
const config = new ConfigObject(); const config = new ConfigObject();
describe('Config with all possible options', () => { describe('Config with all possible options', () => {
@ -37,4 +44,8 @@ describe('Config with all possible options', () => {
}; };
assert.deepStrictEqual(expectedObj, config.outboundProxy); assert.deepStrictEqual(expectedObj, config.outboundProxy);
}); });
after(() => {
process.env = originalEnv;
});
}); });