diff options
author | Steve Azzopardi <steveazz@outlook.com> | 2019-01-24 08:55:22 +0100 |
---|---|---|
committer | Steve Azzopardi <steveazz@outlook.com> | 2019-01-24 09:03:14 +0100 |
commit | cb67423d48f6e5e78c7ecd9196b93edf7666ba0c (patch) | |
tree | 8be43b9f851a1baebf95b9fd05c809409892ae91 /lib | |
parent | 97aa25ba8b87797da268c5b42179df3799347847 (diff) | |
download | gitlab-ce-cb67423d48f6e5e78c7ecd9196b93edf7666ba0c.tar.gz |
Get remote address for runner
Check if `X-Forwarded-For` is set before getting the IP of the request,
with this the real IP address of the runner is shown if it's behind a
proxy.
closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53676
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/helpers/runner.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/helpers/runner.rb b/lib/api/helpers/runner.rb index 45d0343bc89..16df8e830e1 100644 --- a/lib/api/helpers/runner.rb +++ b/lib/api/helpers/runner.rb @@ -26,7 +26,7 @@ module API end def get_runner_ip - { ip_address: request.ip } + { ip_address: request.env["HTTP_X_FORWARDED_FOR"] || request.ip } end def current_runner |