Skip to content

Commit

Permalink
feat: add fallback for deprecated dns (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
nerijunior authored and Diederik van den Burger committed Jul 12, 2018
1 parent fa52091 commit 9f47f6a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/sentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ module.exports = function sentry (moduleOptions) {
// Generate DSN
// https://docs.sentry.io/quickstart/#about-the-dsn
if (!options.dsn || !options.dsn.length) {
options.dsn = `${options.protocol}://${options.public_key}:${options.private_key}@${options.host}${options.path}${options.project_id}`
if (!options.private_key || !options.private_key.length) {
options.dsn = `${options.protocol}://${options.public_key}@${options.host}${options.path}${options.project_id}`
} else {
options.dsn = `${options.protocol}://${options.public_key}:${options.private_key}@${options.host}${options.path}${options.project_id}`
}
}

// Public DSN (without private key)
Expand Down

0 comments on commit 9f47f6a

Please sign in to comment.