Don't require lib/gitlab/request_profiler/middleware.rb in config/initializers/request_profiler.rb

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2017-02-02 10:21:14 +01:00
parent ee59a64b20
commit 6dcfc4002e
3 changed files with 5 additions and 4 deletions

View file

@ -0,0 +1,4 @@
---
title: Don't require lib/gitlab/request_profiler/middleware.rb in config/initializers/request_profiler.rb
merge_request:
author:

View file

@ -1,5 +1,3 @@
require 'gitlab/request_profiler/middleware'
Rails.application.configure do |config| Rails.application.configure do |config|
config.middleware.use(Gitlab::RequestProfiler::Middleware) config.middleware.use(Gitlab::RequestProfiler::Middleware)
end end

View file

@ -1,5 +1,4 @@
require 'ruby-prof' require 'ruby-prof'
require_dependency 'gitlab/request_profiler'
module Gitlab module Gitlab
module RequestProfiler module RequestProfiler
@ -20,7 +19,7 @@ module Gitlab
header_token = env['HTTP_X_PROFILE_TOKEN'] header_token = env['HTTP_X_PROFILE_TOKEN']
return unless header_token.present? return unless header_token.present?
profile_token = RequestProfiler.profile_token profile_token = Gitlab::RequestProfiler.profile_token
return unless profile_token.present? return unless profile_token.present?
header_token == profile_token header_token == profile_token