Skip to content

Commit 38d2bf5

Browse files
committed
mostly remove the ParamsParser middleware
This can still be added to the middleware stack, but is really not necessary. I'll follow up with a commit that deprecates the constant
1 parent a933461 commit 38d2bf5

File tree

8 files changed

+4
-16
lines changed

8 files changed

+4
-16
lines changed

actionpack/test/abstract_unit.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ def self.build_app(routes = nil)
104104
middleware.use ActionDispatch::ShowExceptions, ActionDispatch::PublicExceptions.new("#{FIXTURE_LOAD_PATH}/public")
105105
middleware.use ActionDispatch::DebugExceptions
106106
middleware.use ActionDispatch::Callbacks
107-
middleware.use ActionDispatch::ParamsParser
108107
middleware.use ActionDispatch::Cookies
109108
middleware.use ActionDispatch::Flash
110109
middleware.use Rack::Head

actionview/test/abstract_unit.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ def self.build_app(routes = nil)
151151
middleware.use ActionDispatch::ShowExceptions, ActionDispatch::PublicExceptions.new("#{FIXTURE_LOAD_PATH}/public")
152152
middleware.use ActionDispatch::DebugExceptions
153153
middleware.use ActionDispatch::Callbacks
154-
middleware.use ActionDispatch::ParamsParser
155154
middleware.use ActionDispatch::Cookies
156155
middleware.use ActionDispatch::Flash
157156
middleware.use Rack::Head

guides/source/api_app.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ An API application comes with the following middlewares by default:
194194
- `ActionDispatch::RemoteIp`
195195
- `ActionDispatch::Reloader`
196196
- `ActionDispatch::Callbacks`
197-
- `ActionDispatch::ParamsParser`
198197
- `Rack::Head`
199198
- `Rack::ConditionalGet`
200199
- `Rack::ETag`
@@ -292,9 +291,9 @@ instructions in the `Rack::Sendfile` documentation.
292291
NOTE: The `Rack::Sendfile` middleware is always outside of the `Rack::Lock`
293292
mutex, even in single-threaded applications.
294293

295-
### Using ActionDispatch::ParamsParser
294+
### Using ActionDispatch::Request
296295

297-
`ActionDispatch::ParamsParser` will take parameters from the client in the JSON
296+
`ActionDispatch::Request#params` will take parameters from the client in the JSON
298297
format and make them available in your controller inside `params`.
299298

300299
To use this, your client will need to make a request with JSON-encoded parameters
@@ -313,7 +312,7 @@ jQuery.ajax({
313312
});
314313
```
315314

316-
`ActionDispatch::ParamsParser` will see the `Content-Type` and your parameters
315+
`ActionDispatch::Request` will see the `Content-Type` and your parameters
317316
will be:
318317

319318
```ruby

guides/source/command_line.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ Ruby version 2.2.2 (x86_64-linux)
412412
RubyGems version 2.4.6
413413
Rack version 1.6
414414
JavaScript Runtime Node.js (V8)
415-
Middleware Rack::Sendfile, ActionDispatch::Static, Rack::Lock, #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x007ffd131a7c88>, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::Migration::CheckPending, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, Rack::Head, Rack::ConditionalGet, Rack::ETag
415+
Middleware Rack::Sendfile, ActionDispatch::Static, Rack::Lock, #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x007ffd131a7c88>, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::Migration::CheckPending, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, Rack::Head, Rack::ConditionalGet, Rack::ETag
416416
Application root /home/foobar/commandsapp
417417
Environment development
418418
Database adapter sqlite3

guides/source/configuring.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ Every Rails application comes with a standard set of middleware which it uses in
214214
* `ActionDispatch::Cookies` sets cookies for the request.
215215
* `ActionDispatch::Session::CookieStore` is responsible for storing the session in cookies. An alternate middleware can be used for this by changing the `config.action_controller.session_store` to an alternate value. Additionally, options passed to this can be configured by using `config.action_controller.session_options`.
216216
* `ActionDispatch::Flash` sets up the `flash` keys. Only available if `config.action_controller.session_store` is set to a value.
217-
* `ActionDispatch::ParamsParser` parses out parameters from the request into `params`.
218217
* `Rack::MethodOverride` allows the method to be overridden if `params[:_method]` is set. This is the middleware which supports the PATCH, PUT, and DELETE HTTP method types.
219218
* `Rack::Head` converts HEAD requests to GET requests and serves them as so.
220219

guides/source/rails_on_rack.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ use ActiveRecord::QueryCache
121121
use ActionDispatch::Cookies
122122
use ActionDispatch::Session::CookieStore
123123
use ActionDispatch::Flash
124-
use ActionDispatch::ParamsParser
125124
use Rack::Head
126125
use Rack::ConditionalGet
127126
use Rack::ETag
@@ -284,10 +283,6 @@ Much of Action Controller's functionality is implemented as Middlewares. The fol
284283

285284
* Sets up the flash keys. Only available if `config.action_controller.session_store` is set to a value.
286285

287-
**`ActionDispatch::ParamsParser`**
288-
289-
* Parses out parameters from the request into `params`.
290-
291286
**`Rack::Head`**
292287

293288
* Converts HEAD requests to `GET` requests and serves them as so.

railties/lib/rails/application/default_middleware_stack.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def build_stack
7272
middleware.use ::ActionDispatch::Flash
7373
end
7474

75-
middleware.use ::ActionDispatch::ParamsParser
7675
middleware.use ::Rack::Head
7776
middleware.use ::Rack::ConditionalGet
7877
middleware.use ::Rack::ETag, "no-cache"

railties/test/application/middleware_test.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def app
4343
"ActionDispatch::Cookies",
4444
"ActionDispatch::Session::CookieStore",
4545
"ActionDispatch::Flash",
46-
"ActionDispatch::ParamsParser",
4746
"Rack::Head",
4847
"Rack::ConditionalGet",
4948
"Rack::ETag"
@@ -70,7 +69,6 @@ def app
7069
"ActionDispatch::Callbacks",
7170
"ActiveRecord::ConnectionAdapters::ConnectionManagement",
7271
"ActiveRecord::QueryCache",
73-
"ActionDispatch::ParamsParser",
7472
"Rack::Head",
7573
"Rack::ConditionalGet",
7674
"Rack::ETag"

0 commit comments

Comments
 (0)