summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-07-29 13:10:16 +0000
committerStan Hu <stanhu@gmail.com>2019-07-29 13:10:16 +0000
commit914bfabba6708696c049d3a0304d67873b39c047 (patch)
tree944bce7776c406d1093c0be6dcc2ec9dea802fb4 /lib
parentf7641d848d6b6356c0e5a66e32c0f7fb2aae1b19 (diff)
parent6cfd13726fbce725633d95140dd0e4bf1779c5db (diff)
downloadgitlab-ce-914bfabba6708696c049d3a0304d67873b39c047.tar.gz
Merge branch 'ce-port-4550-add-project-download-export-audit-event' into 'master'
CE: Add project download & project export audit event See merge request gitlab-org/gitlab-ce!31103
Diffstat (limited to 'lib')
-rw-r--r--lib/api/helpers.rb4
-rw-r--r--lib/api/helpers/runner.rb2
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 8ae42c6dadd..1aa6dc44bf7 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -544,5 +544,9 @@ module API
params[:archived]
end
+
+ def ip_address
+ env["action_dispatch.remote_ip"].to_s || request.ip
+ end
end
end
diff --git a/lib/api/helpers/runner.rb b/lib/api/helpers/runner.rb
index 100463fcb95..5b87eccf860 100644
--- a/lib/api/helpers/runner.rb
+++ b/lib/api/helpers/runner.rb
@@ -25,7 +25,7 @@ module API
end
def get_runner_ip
- { ip_address: env["action_dispatch.remote_ip"].to_s || request.ip }
+ { ip_address: ip_address }
end
def current_runner