summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-09-12 21:02:57 +0000
committerRobert Speicher <robert@gitlab.com>2016-09-12 21:02:57 +0000
commit0a250cf9eb317c9f94dedc40b2dea9510e74fe09 (patch)
tree892e0594a8d7a92f50868b295b253f9c0fa77252 /config
parent4c87d98fee38d16a12b0acac5400c0cbb52576ee (diff)
parent8b6bbc866d78ec8d4d8a99c0862c9d4c30398d90 (diff)
downloadgitlab-ce-0a250cf9eb317c9f94dedc40b2dea9510e74fe09.tar.gz
Merge branch 'rails-5-backports' into 'master'
Fix two problematic bits of code that will be deprecated or broken in Rails 5. Found in the Rails 5 MR: !5555 These are safe to use in Rails 4.2.7 as well as Rails 5.0.0, so I figured I'd backport them for the sake of making that merge request smaller. The explanation for the mime_types.rb code is here: https://github.com/rails-api/active_model_serializers/issues/1027#issuecomment-126543577 See merge request !6214
Diffstat (limited to 'config')
-rw-r--r--config/initializers/mime_types.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
index f498732feca..5e3e4c966cb 100644
--- a/config/initializers/mime_types.rb
+++ b/config/initializers/mime_types.rb
@@ -13,9 +13,5 @@ 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
-})
+Mime::Type.unregister :json
+Mime::Type.register 'application/json', :json, %w(application/vnd.git-lfs+json application/json)