From 07f138866b4509b1564fd76f734d9ad61b0d5727 Mon Sep 17 00:00:00 2001 From: Oskar Damkjaer Date: Wed, 16 Sep 2020 14:35:26 +0200 Subject: [PATCH] Add useragent when to neo4j-driver config --- src/shared/services/bolt/driverFactory.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/services/bolt/driverFactory.js b/src/shared/services/bolt/driverFactory.js index 0e9e2d90f2b..2ea8f37a739 100644 --- a/src/shared/services/bolt/driverFactory.js +++ b/src/shared/services/bolt/driverFactory.js @@ -19,11 +19,12 @@ */ import neo4j from 'neo4j-driver' +import { version } from 'project-root/package.json' export const createDriverOrFailFn = (url, auth, opts, failFn = () => {}) => { // This is needed, I haven't figured out why. I don't find any mutations to // the object, so not sure what's going on. - const spreadOpts = { ...opts } + const spreadOpts = { ...opts, userAgent: `neo4j-browser/v${version}` } try { const res = neo4j.driver(url, auth, spreadOpts) return res