From 9212edbaa9379a66d7f4b798d352675d4e2a1e1b Mon Sep 17 00:00:00 2001 From: MaxAake <61233757+MaxAake@users.noreply.github.com> Date: Tue, 11 Feb 2025 14:51:32 +0100 Subject: [PATCH] parse available bolt versions as strings --- packages/bolt-connection/src/bolt/handshake.js | 4 ++-- .../neo4j-driver-deno/lib/bolt-connection/bolt/handshake.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/bolt-connection/src/bolt/handshake.js b/packages/bolt-connection/src/bolt/handshake.js index 47c26def7..7f1d2a1c4 100644 --- a/packages/bolt-connection/src/bolt/handshake.js +++ b/packages/bolt-connection/src/bolt/handshake.js @@ -19,7 +19,7 @@ import { alloc } from '../channel' import { newError } from 'neo4j-driver-core' const BOLT_MAGIC_PREAMBLE = 0x6060b017 -const AVAILABLE_BOLT_PROTOCOLS = [5.8, 5.7, 5.6, 5.4, 5.3, 5.2, 5.1, 5.0, 4.4, 4.3, 4.2, 3.0] // bolt protocols the client will accept, ordered by preference +const AVAILABLE_BOLT_PROTOCOLS = ['5.8', '5.7', '5.6', '5.4', '5.3', '5.2', '5.1', '5.0', '4.4', '4.3', '4.2', '3.0'] // bolt protocols the client will accept, ordered by preference const DESIRED_CAPABILITES = 0 function version (major, minor) { @@ -98,7 +98,7 @@ function handshakeNegotiationV2 (channel, buffer, log) { }) for (let i = 0; i < versions.length; i++) { const version = versions[i] - if (AVAILABLE_BOLT_PROTOCOLS.includes(Number(version.major + '.' + version.minor))) { + if (AVAILABLE_BOLT_PROTOCOLS.includes(version.major + '.' + version.minor)) { major = version.major minor = version.minor break diff --git a/packages/neo4j-driver-deno/lib/bolt-connection/bolt/handshake.js b/packages/neo4j-driver-deno/lib/bolt-connection/bolt/handshake.js index 9ad9846c1..ddf9bccca 100644 --- a/packages/neo4j-driver-deno/lib/bolt-connection/bolt/handshake.js +++ b/packages/neo4j-driver-deno/lib/bolt-connection/bolt/handshake.js @@ -19,7 +19,7 @@ import { alloc } from '../channel/index.js' import { newError } from '../../core/index.ts' const BOLT_MAGIC_PREAMBLE = 0x6060b017 -const AVAILABLE_BOLT_PROTOCOLS = [5.8, 5.7, 5.6, 5.4, 5.3, 5.2, 5.1, 5.0, 4.4, 4.3, 4.2, 3.0] // bolt protocols the client will accept, ordered by preference +const AVAILABLE_BOLT_PROTOCOLS = ['5.8', '5.7', '5.6', '5.4', '5.3', '5.2', '5.1', '5.0', '4.4', '4.3', '4.2', '3.0'] // bolt protocols the client will accept, ordered by preference const DESIRED_CAPABILITES = 0 function version (major, minor) { @@ -98,7 +98,7 @@ function handshakeNegotiationV2 (channel, buffer, log) { }) for (let i = 0; i < versions.length; i++) { const version = versions[i] - if (AVAILABLE_BOLT_PROTOCOLS.includes(Number(version.major + '.' + version.minor))) { + if (AVAILABLE_BOLT_PROTOCOLS.includes(version.major + '.' + version.minor)) { major = version.major minor = version.minor break