From c7d717cf6a452afbf71158bddce78fdd29368d5b Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Mon, 5 Sep 2016 20:58:27 -0600 Subject: Fix two problematic bits of code that will be deprecated or broken in Rails 5. --- config/initializers/mime_types.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'config/initializers') diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index f498732feca..350388fedbe 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -13,9 +13,11 @@ Mime::Type.register "video/mp4", :mp4, [], [:m4v, :mov] Mime::Type.register "video/webm", :webm Mime::Type.register "video/ogg", :ogv -middlewares = Gitlab::Application.config.middleware -middlewares.swap(ActionDispatch::ParamsParser, ActionDispatch::ParamsParser, { - Mime::Type.lookup('application/vnd.git-lfs+json') => lambda do |body| - ActiveSupport::JSON.decode(body) - end -}) +lfs_mime_types = %w( + application/vnd.git-lfs+json + text/x-json + application/json +) + +Mime::Type.unregister :json +Mime::Type.register 'application/json', :json, lfs_mime_types -- cgit v1.2.1