Skip to content

Commit

Permalink
Add useragent when to neo4j-driver config
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarDamkjaer committed Sep 16, 2020
1 parent 4ec9e6a commit 07f1388
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/shared/services/bolt/driverFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 07f1388

Please sign in to comment.