Skip to content

Commit

Permalink
Merge pull request #1195 from OskarDamkjaer/useragent_driver
Browse files Browse the repository at this point in the history
Add useragent when to neo4j-driver config
  • Loading branch information
OskarDamkjaer authored Sep 16, 2020
2 parents 4ec9e6a + 07f1388 commit 434515f
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 434515f

Please sign in to comment.