Skip to content

Commit 6a910af

Browse files
committed
jenkins: handle IPv4 remote address converted to IPv6
After the Jenkins IP whitelist was activated, the inline PR status reports for nodejs/node seems to be broken. Seems like the issue here is that IPv4 remote addresses are converted to IPv6, which wasn't expected too happen.. Stripping any IPv6 parts off the remote addresses should make our IPv4 comparisons work as expected. Refs nodejs/build#1016 Refs nodejs/build#985
1 parent af20ad8 commit 6a910af

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/jenkins-status.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const enabledRepos = ['citgm', 'http-parser', 'node']
66
const jenkinsIpWhitelist = process.env.JENKINS_WORKER_IPS ? process.env.JENKINS_WORKER_IPS.split(',') : []
77

88
function isJenkinsIpWhitelisted (req) {
9-
const ip = req.connection.remoteAddress
9+
const ip = req.connection.remoteAddress.split(':').pop()
1010

1111
if (jenkinsIpWhitelist.length && !jenkinsIpWhitelist.includes(ip)) {
1212
req.log.warn({ ip }, 'Ignoring, not allowed to push Jenkins updates')

0 commit comments

Comments
 (0)