summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-02-02 21:33:43 +0000
committerRobert Speicher <robert@gitlab.com>2017-02-02 21:33:43 +0000
commit1c13cea779b584a9f053e67e1cb6b77d103287dc (patch)
tree8cfa26d7eaf9e42443405f68f54830054d372a8f
parent19a39aa726a5d5ec243958b5b861b83989176374 (diff)
parent6dcfc4002e24c54c2f60b53bb2761a300bf68735 (diff)
downloadgitlab-ce-1c13cea779b584a9f053e67e1cb6b77d103287dc.tar.gz
Merge branch '20452-remove-require-from-request_profiler-initializer' into 'master' 27537-flash-of-human-un-friendly-utc-timestamp
Don't require lib/gitlab/request_profiler/middleware.rb in config/initializers/request_profiler.rb Closes #20452 See merge request !8927
-rw-r--r--changelogs/unreleased/20452-remove-require-from-request_profiler-initializer.yml4
-rw-r--r--config/initializers/request_profiler.rb2
-rw-r--r--lib/gitlab/request_profiler/middleware.rb3
3 files changed, 5 insertions, 4 deletions
diff --git a/changelogs/unreleased/20452-remove-require-from-request_profiler-initializer.yml b/changelogs/unreleased/20452-remove-require-from-request_profiler-initializer.yml
new file mode 100644
index 00000000000..965d0648adf
--- /dev/null
+++ b/changelogs/unreleased/20452-remove-require-from-request_profiler-initializer.yml
@@ -0,0 +1,4 @@
+---
+title: Don't require lib/gitlab/request_profiler/middleware.rb in config/initializers/request_profiler.rb
+merge_request:
+author:
diff --git a/config/initializers/request_profiler.rb b/config/initializers/request_profiler.rb
index a9aa802681a..fb5a7b8372e 100644
--- a/config/initializers/request_profiler.rb
+++ b/config/initializers/request_profiler.rb
@@ -1,5 +1,3 @@
-require 'gitlab/request_profiler/middleware'
-
Rails.application.configure do |config|
config.middleware.use(Gitlab::RequestProfiler::Middleware)
end
diff --git a/lib/gitlab/request_profiler/middleware.rb b/lib/gitlab/request_profiler/middleware.rb
index 786e1d49f5e..ef42b0557e0 100644
--- a/lib/gitlab/request_profiler/middleware.rb
+++ b/lib/gitlab/request_profiler/middleware.rb
@@ -1,5 +1,4 @@
require 'ruby-prof'
-require_dependency 'gitlab/request_profiler'
module Gitlab
module RequestProfiler
@@ -20,7 +19,7 @@ module Gitlab
header_token = env['HTTP_X_PROFILE_TOKEN']
return unless header_token.present?
- profile_token = RequestProfiler.profile_token
+ profile_token = Gitlab::RequestProfiler.profile_token
return unless profile_token.present?
header_token == profile_token