We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33db5c5 commit e1e8e4bCopy full SHA for e1e8e4b
scripts/jenkins-status.js
@@ -6,13 +6,11 @@ const enabledRepos = ['citgm', 'node']
6
const jenkinsIpWhitelist = process.env.JENKINS_WORKER_IPS ? process.env.JENKINS_WORKER_IPS.split(',') : []
7
8
function isJenkinsIpWhitelisted (req) {
9
- const ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress
+ const ip = req.connection.remoteAddress
10
11
- if (jenkinsIpWhitelist.length) {
12
- if (!jenkinsIpWhitelist.includes(ip)) {
13
- req.log.warn({ ip }, 'Ignoring, not allowed to push Jenkins updates')
14
- return false
15
- }
+ if (jenkinsIpWhitelist.length && !jenkinsIpWhitelist.includes(ip)) {
+ req.log.warn({ ip }, 'Ignoring, not allowed to push Jenkins updates')
+ return false
16
}
17
18
return true
0 commit comments