]> git.openstreetmap.org Git - rails.git/blob - config/initializers/action_dispatch.rb
Merge remote-tracking branch 'openstreetmap/pull/1496'
[rails.git] / config / initializers / action_dispatch.rb
1 # Stop rails from automatically parsing XML in request bodies
2 Rails.configuration.middleware.delete ActionDispatch::ParamsParser
3
4 # https://github.com/rails/rails/issues/20710
5 module ActionDispatch
6   module Assertions
7     def html_document_with_rss
8       @html_document ||= if @response.content_type == Mime::RSS
9                            Nokogiri::XML::Document.parse(@response.body)
10                          else
11                            html_document_without_rss
12                          end
13     end
14
15     alias_method_chain :html_document, :rss
16   end
17 end