aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/request.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-09-18 11:46:51 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-09-18 11:46:51 -0700
commitb93c226d19615fe504f9e12d6c0ee2d70683e5fa (patch)
treecd3cdb9234445e13a7fecaec2f4014f2c4122dbc /actionpack/lib/action_dispatch/http/request.rb
parent91d05082e43008f2617d468fdd6c0de95855fe7f (diff)
downloadrails-b93c226d19615fe504f9e12d6c0ee2d70683e5fa.tar.gz
rails-b93c226d19615fe504f9e12d6c0ee2d70683e5fa.tar.bz2
rails-b93c226d19615fe504f9e12d6c0ee2d70683e5fa.zip
push the parameter parsers on to the class
The middleware stack is a singleton in the application (one instance is shared for the entire application) which means that there was only one opportunity to set the parameter parsers. Since there is only one set of parameter parsers in an app, lets just configure them on the request class (since that is where they are used).
Diffstat (limited to 'actionpack/lib/action_dispatch/http/request.rb')
-rw-r--r--actionpack/lib/action_dispatch/http/request.rb25
1 files changed, 0 insertions, 25 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index ea083425ba..cb59510613 100644
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -361,16 +361,6 @@ module ActionDispatch
end
alias :request_parameters :POST
- def params_parsers
- fetch_header "action_dispatch.request.params_parsers" do
- {}
- end
- end
-
- def params_parsers= hash
- set_header "action_dispatch.request.params_parsers", hash
- end
-
# Returns the authorization header regardless of whether it was specified directly or through one of the
# proxy alternatives.
def authorization
@@ -399,20 +389,5 @@ module ActionDispatch
HTTP_METHOD_LOOKUP[name] || raise(ActionController::UnknownHttpMethod, "#{name}, accepted HTTP methods are #{HTTP_METHODS[0...-1].join(', ')}, and #{HTTP_METHODS[-1]}")
name
end
-
- def parse_formatted_parameters(request, parsers)
- return yield if request.content_length.zero?
-
- strategy = parsers.fetch(request.content_mime_type) { return yield }
-
- begin
- strategy.call(request.raw_post)
- rescue => e # JSON or Ruby code block errors
- my_logger = logger || ActiveSupport::Logger.new($stderr)
- my_logger.debug "Error occurred while parsing request parameters.\nContents:\n\n#{request.raw_post}"
-
- raise ParamsParser::ParseError.new(e.message, e)
- end
- end
end
end