Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/instrumentation/http-shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,12 @@ function isRequestBlacklisted (agent, req) {
// NOTE: This will also stringify and parse URL instances
// to a format which can be mixed into the options object.
function ensureUrl (v) {
if (typeof v === 'string' || v instanceof url.URL) {
return url.parse(String(v))
if (typeof v === 'string') {
return url.parse(v)
} else if (v instanceof url.Url) {
return v
} else if (url.URL && v instanceof url.URL) { // check for url.URL because it wasn't added until Node.js 6.13.0
return url.parse(v.toString())
} else {
return v
}
Expand Down