diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /config/initializers/labkit_middleware.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'config/initializers/labkit_middleware.rb')
-rw-r--r-- | config/initializers/labkit_middleware.rb | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/config/initializers/labkit_middleware.rb b/config/initializers/labkit_middleware.rb deleted file mode 100644 index 748666b6cd7..00000000000 --- a/config/initializers/labkit_middleware.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -# partial backport of https://github.com/rails/rails/pull/38169 -# this is in order to be able to re-order rack middlewares. - -if ActionDispatch::MiddlewareStack.method_defined?(:move) - warn "`move` is now defined in in ActionDispatch itself: https://github.com/rails/rails/pull/38169, please remove this patch from #{__FILE__}" -else - module ActionDispatch - class MiddlewareStack - def move(target, source) - source_index = assert_index(source, :before) - source_middleware = middlewares.delete_at(source_index) - - target_index = assert_index(target, :before) - middlewares.insert(target_index, source_middleware) - end - end - end -end - -unless Rails::Configuration::MiddlewareStackProxy.method_defined?(:move) - module Rails - module Configuration - class MiddlewareStackProxy - def move(*args, &block) - @operations << ->(middleware) { middleware.send(__method__, *args, &block) } - end - ruby2_keywords(:move) if respond_to?(:ruby2_keywords, true) - end - end - end -end - -Rails.application.config.middleware.move(1, ActionDispatch::RequestId) -Rails.application.config.middleware.insert_after(ActionDispatch::RequestId, Labkit::Middleware::Rack) |