Skip to content

Commit da0a6f7

Browse files
authored
chore: bump node-libcurl for electron 43 and windows arm support [INS-3111] (#10305)
1 parent 4987454 commit da0a6f7

8 files changed

Lines changed: 117 additions & 112 deletions

File tree

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
24.14.0
1+
24.18.0

package-lock.json

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

package.json

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"homepage": "https://github.com/kong/insomnia#readme",
1313
"engines": {
14-
"node": ">=24",
14+
"node": ">=24.18.0",
1515
"npm": ">=11"
1616
},
1717
"workspaces": [
@@ -31,8 +31,8 @@
3131
"type-check": "npm run type-check --workspaces --if-present",
3232
"test": "npm run test --workspaces --if-present",
3333
"clean": "git clean -dfX",
34-
"install-libcurl-electron": "node-pre-gyp install --directory node_modules/@getinsomnia/node-libcurl --update-binary --runtime=electron --target=41.0.3",
35-
"install-libcurl-node": "node-pre-gyp install --directory node_modules/@getinsomnia/node-libcurl --update-binary --runtime=node --target=24.14.0",
34+
"install-libcurl-electron": "node-pre-gyp install --directory node_modules/@getinsomnia/node-libcurl --update-binary --runtime=electron --target=43.2.0",
35+
"install-libcurl-node": "node-pre-gyp install --directory node_modules/@getinsomnia/node-libcurl --update-binary --runtime=node --target=24.18.0",
3636
"inso-start": "npm start -w insomnia-inso",
3737
"inso-package": "npm run build -w insomnia-inso && npm run package -w insomnia-inso",
3838
"watch:app": "npm run build:electron-entrypoints -w insomnia && npm run start:dev-server -w insomnia",
@@ -83,7 +83,18 @@
8383
}
8484
},
8585
"dependencies": {
86-
"@getinsomnia/node-libcurl": "3.2.2",
86+
"@getinsomnia/node-libcurl": "3.3.0",
8787
"ajv": "^8.17.1"
88+
},
89+
"allowScripts": {
90+
"@getinsomnia/node-libcurl@3.3.0": true,
91+
"@scarf/scarf@1.4.0": true,
92+
"electron-winstaller@5.4.0": true,
93+
"esbuild@0.25.12": true,
94+
"esbuild@0.27.5": true,
95+
"fsevents@2.3.2": true,
96+
"fsevents@2.3.3": true,
97+
"node-llama-cpp@3.18.1": true,
98+
"protobufjs@7.6.4": true
8899
}
89100
}

packages/insomnia-data/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"uuid": "^9.0.1"
4242
},
4343
"devDependencies": {
44-
"@getinsomnia/node-libcurl": "3.2.2",
44+
"@getinsomnia/node-libcurl": "3.3.0",
4545
"@modelcontextprotocol/sdk": "^1.17.5",
4646
"@types/deep-equal": "^1.0.4",
4747
"mocha": "^11.7.5",

packages/insomnia/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"@fortawesome/free-regular-svg-icons": "^6.7.2",
6060
"@fortawesome/free-solid-svg-icons": "^6.7.2",
6161
"@fortawesome/react-fontawesome": "^3.0.2",
62-
"@getinsomnia/node-libcurl": "3.2.2",
62+
"@getinsomnia/node-libcurl": "3.3.0",
6363
"@getinsomnia/srp-js": "1.0.0-alpha.1",
6464
"@grpc/grpc-js": "^1.14.4",
6565
"@grpc/proto-loader": "^0.7.13",
@@ -202,7 +202,7 @@
202202
"@types/ws": "^8.18.1",
203203
"@vitejs/plugin-react": "5.1.2",
204204
"cross-env": "^10.1.0",
205-
"electron": "41.0.3",
205+
"electron": "43.2.0",
206206
"electron-builder": "26.8.1",
207207
"electron-builder-squirrel-windows": "26.8.1",
208208
"electron-devtools-installer": "^3.2.1",

packages/insomnia/src/main/__tests__/templating-worker-database-protocol-authorization.test.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,37 @@ describe('resolveDbByKey requires a valid protocol auth token', () => {
114114
});
115115
});
116116

117+
describe('resolveDbByKey answers CORS preflight and tags responses with CORS headers', () => {
118+
beforeEach(() => {
119+
_testOnlyResetTemplatingDbAuthToken();
120+
});
121+
122+
it('answers an OPTIONS preflight with 204 and CORS headers, without requiring a token', async () => {
123+
const { resolveDbByKey } = await import('../templating-worker-database');
124+
const req = new Request('insomnia-templating-worker-database://settings.get', {
125+
method: 'OPTIONS',
126+
headers: { Origin: 'https://insomnia-app.local' },
127+
});
128+
const res = await resolveDbByKey(req);
129+
expect(res.status).toBe(204);
130+
expect(res.headers.get('Access-Control-Allow-Origin')).toBe('https://insomnia-app.local');
131+
expect(res.headers.get('Access-Control-Allow-Headers')).toContain(TEMPLATING_DB_AUTH_HEADER);
132+
expect(res.headers.get('Access-Control-Allow-Methods')).toContain('OPTIONS');
133+
});
134+
135+
it('tags an authorized response with an Access-Control-Allow-Origin echoing the request Origin', async () => {
136+
const token = getOrCreateTemplatingDbAuthToken();
137+
const { resolveDbByKey } = await import('../templating-worker-database');
138+
const req = new Request('insomnia-templating-worker-database://settings.get', {
139+
method: 'POST',
140+
headers: { [TEMPLATING_DB_AUTH_HEADER]: token, Origin: 'https://insomnia-app.local' },
141+
body: '{}',
142+
});
143+
const res = await resolveDbByKey(req);
144+
expect(res.headers.get('Access-Control-Allow-Origin')).toBe('https://insomnia-app.local');
145+
});
146+
});
147+
117148
describe('protocol-dispatch handlers resolve `directory` from the trusted registry, not the request body', () => {
118149
let legitDir: string;
119150
let foreignDir: string;

packages/insomnia/src/main/api.protocol.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export async function registerInsomniaProtocols() {
2828
standard: true,
2929
supportFetchAPI: true,
3030
stream: true,
31+
corsEnabled: true,
3132
},
3233
},
3334
{
@@ -40,7 +41,7 @@ export async function registerInsomniaProtocols() {
4041
},
4142
{
4243
scheme: templatingWorkerDatabaseInterface,
43-
privileges: { secure: true, standard: true, supportFetchAPI: true },
44+
privileges: { secure: true, standard: true, supportFetchAPI: true, corsEnabled: true },
4445
},
4546
]);
4647

0 commit comments

Comments
 (0)