Skip to content

Commit

Permalink
hapi test: use localhost rather than '0.0.0.0' default to match clien…
Browse files Browse the repository at this point in the history
…t request address

This is a workaround for nodejs/node#40537
  • Loading branch information
trentm committed Oct 20, 2021
1 parent fa2cef4 commit f466ab4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/instrumentation/modules/hapi/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ module.exports = (moduleName) => {
captureExceptions: false,
logLevel: 'fatal',
metricsInterval: 0,
centralConfig: false
centralConfig: false,
cloudProvider: 'none'
})

var isHapiIncompat = require('../../../_is_hapi_incompat')
Expand Down Expand Up @@ -48,7 +49,7 @@ module.exports = (moduleName) => {
agent.captureError = originalCaptureError

var server = startServer(function (err, port) {
t.error(err)
t.error(err, 'no error from startServer')
http.get('http://localhost:' + port + '/captureError?foo=bar')
})
})
Expand Down Expand Up @@ -523,7 +524,7 @@ module.exports = (moduleName) => {
})

function makeServer (opts) {
var server = new Hapi.Server()
var server = new Hapi.Server({ host: 'localhost' })
if (semver.satisfies(pkg.version, '<17')) {
server.connection(opts)
}
Expand Down

0 comments on commit f466ab4

Please sign in to comment.