summaryrefslogtreecommitdiff
path: root/lib/api/helpers/runner.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/helpers/runner.rb')
-rw-r--r--lib/api/helpers/runner.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/api/helpers/runner.rb b/lib/api/helpers/runner.rb
index ff73a49d5e8..5b87eccf860 100644
--- a/lib/api/helpers/runner.rb
+++ b/lib/api/helpers/runner.rb
@@ -7,8 +7,7 @@ module API
JOB_TOKEN_PARAM = :token
def runner_registration_token_valid?
- ActiveSupport::SecurityUtils.variable_size_secure_compare(params[:token],
- Gitlab::CurrentSettings.runners_registration_token)
+ ActiveSupport::SecurityUtils.secure_compare(params[:token], Gitlab::CurrentSettings.runners_registration_token)
end
def authenticate_runner!
@@ -26,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