Skip to content

Commit 4c7ab0d

Browse files
Merge pull request #811 from splitio/development
Release v10.27.0
2 parents 04e3f08 + b0b5bb7 commit 4c7ab0d

File tree

9 files changed

+142
-80
lines changed

9 files changed

+142
-80
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
10.27.0 (June 25, 2024)
2+
- Added `sync.requestOptions.agent` option to SDK configuration for NodeJS. This allows passing a custom NodeJS HTTP(S) Agent with specific configurations for the SDK requests, like custom TLS settings or a network proxy (See https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#proxy).
3+
- Updated some transitive dependencies for vulnerability fixes.
4+
15
10.26.1 (June 14, 2024)
26
- Updated the internal imports of 'os' and 'ioredis' modules for NodeJS, to use EcmaScript 'import' rather than CommonJS 'require' for the ES modules build. This avoids runtime errors on some scenarios when bundling the SDK into a .mjs file or importing it from a .mjs file.
37
- Updated eventsource dependency for NodeJS. The eventsource v1.1.2 dependency was removed, and the SDK now uses an embedded adaptation that can accept an HTTP(S) agent option, like other HTTP(S) requests.

package-lock.json

Lines changed: 80 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splitsoftware/splitio",
3-
"version": "10.26.1",
3+
"version": "10.27.0",
44
"description": "Split SDK",
55
"files": [
66
"README.md",

src/platform/getOptions/__tests__/node.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@ tape('getOptions returns undefined if some url is not https', assert => {
1515

1616
assert.end();
1717
});
18+
19+
tape('getOptions returns the provided options from settings', assert => {
20+
const customRequestOptions = { agent: false };
21+
const settings = settingsFactory({ sync: { requestOptions: customRequestOptions } });
22+
assert.equal(getOptions(settings), customRequestOptions);
23+
24+
assert.end();
25+
});

src/platform/getOptions/node.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ const agent = new https.Agent({
1111
});
1212

1313
export function getOptions(settings) {
14+
// User provided options take precedence
15+
if (settings.sync.requestOptions) return settings.sync.requestOptions;
16+
1417
// If some URL is not HTTPS, we don't use the agent, to let the SDK connect to HTTP endpoints
1518
if (find(settings.urls, url => !url.startsWith('https:'))) return;
1619

src/settings/defaults/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const packageVersion = '10.26.1';
1+
export const packageVersion = '10.27.0';

src/settings/node.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,9 @@ const params = {
1717
};
1818

1919
export function settingsFactory(config) {
20-
return settingsValidation(config, params);
20+
const settings = settingsValidation(config, params);
21+
22+
// if provided, keeps reference to the `requestOptions` object
23+
if (settings.sync.requestOptions) settings.sync.requestOptions = config.sync.requestOptions;
24+
return settings;
2125
}

ts-tests/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,10 @@ let fullNodeSettings: SplitIO.INodeSettings = {
616616
sync: {
617617
splitFilters: splitFilters,
618618
impressionsMode: 'OPTIMIZED',
619-
enabled: true
619+
enabled: true,
620+
requestOptions: {
621+
agent: new (require('https')).Agent(),
622+
}
620623
}
621624
};
622625
fullNodeSettings.storage.type = 'MEMORY';

0 commit comments

Comments
 (0)