debian-mirror-gitlab/lib/gitlab/qa.rb

18 lines
405 B
Ruby
Raw Normal View History

2023-01-13 00:05:48 +05:30
# 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