diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-15 06:11:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-15 06:11:37 +0300 |
commit | aa9f2954530d4b43a4e3b190b7769fe5b6b6a64e (patch) | |
tree | 4f6f50b00030f7edc01a7ad23f5744a1abcde0aa /lib/gitlab/qa.rb | |
parent | 38b948a54e00841b51c446beb0adf079af60c963 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/qa.rb')
-rw-r--r-- | lib/gitlab/qa.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/gitlab/qa.rb b/lib/gitlab/qa.rb new file mode 100644 index 00000000000..c47a8982901 --- /dev/null +++ b/lib/gitlab/qa.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Gitlab + module Qa + def self.user_agent + ENV['GITLAB_QA_USER_AGENT'] + end + + def self.request?(request_user_agent) + return false unless Gitlab.com? + return false unless request_user_agent.present? + return false unless user_agent.present? + + ActiveSupport::SecurityUtils.secure_compare(request_user_agent, user_agent) + end + end +end |