Skip to content

Commit

Permalink
fix(devtools-proxy-support): fix node version check (#480)
Browse files Browse the repository at this point in the history
`process.version === 'v' + process.versions.node` 🙃
  • Loading branch information
addaleax authored Oct 7, 2024
1 parent bd599ce commit ad9ef54
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/devtools-proxy-support/src/system-ca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,12 @@ export function sortByExpirationDate(ca: ParsedX509Cert[]) {
});
}

const nodeVersion = process.versions.node.slice(1).split('.').map(Number);
const nodeVersion = process.versions.node.split('.').map(Number);

export function tlsSupportsAllowPartialTrustChainFlag(): boolean {
// TODO: Remove this flag and all X.509 parsing here once all our products
// are at least on these Node.js versions
return (
!!(process as any).__tlsSupportsAllowPartialTrustChainFlag || // for mongosh patch
(nodeVersion[0] >= 22 && nodeVersion[1] >= 9) || // https://github.com/nodejs/node/commit/c2bf0134c
(nodeVersion[0] === 20 && nodeVersion[1] >= 18)
); // https://github.com/nodejs/node/commit/1b3420274
Expand Down

0 comments on commit ad9ef54

Please sign in to comment.