We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 85aa716 commit 8b86ff2Copy full SHA for 8b86ff2
test/instrumentation/modules/hapi/shared.js
@@ -524,9 +524,16 @@ module.exports = (moduleName) => {
524
})
525
526
function makeServer (opts) {
527
- var server = new Hapi.Server({ host: 'localhost' })
+ // Specify 'localhost' to avoid Hapi default of '0.0.0.0' which ties to
528
+ // IPv4. We want a later HTTP client request using 'localhost' to work.
529
+ var server
530
if (semver.satisfies(pkg.version, '<17')) {
531
+ server = new Hapi.Server()
532
+ opts = opts || {}
533
+ opts.host = opts.host || 'localhost'
534
server.connection(opts)
535
+ } else {
536
+ server = new Hapi.Server({ host: 'localhost' })
537
}
538
return server
539
0 commit comments