summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorConnor Shea <connor.james.shea@gmail.com>2016-09-05 20:58:27 -0600
committerConnor Shea <connor.james.shea@gmail.com>2016-09-05 20:58:27 -0600
commitc7d717cf6a452afbf71158bddce78fdd29368d5b (patch)
tree6ab6bed7c83c06740c6421592a4a742c7bee17e2 /config
parentad599eb65c8ce483a7faaffe226ec7ce53da0f55 (diff)
downloadgitlab-ce-c7d717cf6a452afbf71158bddce78fdd29368d5b.tar.gz
Fix two problematic bits of code that will be deprecated or broken in Rails 5.
Diffstat (limited to 'config')
-rw-r--r--config/initializers/mime_types.rb14
1 files changed, 8 insertions, 6 deletions
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