mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #17737 from yui-knk/fix/head
Replace ActionDispatch::Head with Rack::Head.
This commit is contained in:
commit
48a8830587
2 changed files with 5 additions and 5 deletions
|
@ -214,7 +214,7 @@ Every Rails application comes with a standard set of middleware which it uses in
|
|||
* `ActionDispatch::Flash` sets up the `flash` keys. Only available if `config.action_controller.session_store` is set to a value.
|
||||
* `ActionDispatch::ParamsParser` parses out parameters from the request into `params`.
|
||||
* `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.
|
||||
* `ActionDispatch::Head` converts HEAD requests to GET requests and serves them as so.
|
||||
* `Rack::Head` converts HEAD requests to GET requests and serves them as so.
|
||||
|
||||
Besides these usual middleware, you can add your own by using the `config.middleware.use` method:
|
||||
|
||||
|
@ -225,13 +225,13 @@ config.middleware.use Magical::Unicorns
|
|||
This will put the `Magical::Unicorns` middleware on the end of the stack. You can use `insert_before` if you wish to add a middleware before another.
|
||||
|
||||
```ruby
|
||||
config.middleware.insert_before ActionDispatch::Head, Magical::Unicorns
|
||||
config.middleware.insert_before Rack::Head, Magical::Unicorns
|
||||
```
|
||||
|
||||
There's also `insert_after` which will insert a middleware after another:
|
||||
|
||||
```ruby
|
||||
config.middleware.insert_after ActionDispatch::Head, Magical::Unicorns
|
||||
config.middleware.insert_after Rack::Head, Magical::Unicorns
|
||||
```
|
||||
|
||||
Middlewares can also be completely swapped out and replaced with others:
|
||||
|
|
|
@ -18,11 +18,11 @@ module Rails
|
|||
# This will put the <tt>Magical::Unicorns</tt> middleware on the end of the stack.
|
||||
# You can use +insert_before+ if you wish to add a middleware before another:
|
||||
#
|
||||
# config.middleware.insert_before ActionDispatch::Head, Magical::Unicorns
|
||||
# config.middleware.insert_before Rack::Head, Magical::Unicorns
|
||||
#
|
||||
# There's also +insert_after+ which will insert a middleware after another:
|
||||
#
|
||||
# config.middleware.insert_after ActionDispatch::Head, Magical::Unicorns
|
||||
# config.middleware.insert_after Rack::Head, Magical::Unicorns
|
||||
#
|
||||
# Middlewares can also be completely swapped out and replaced with others:
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue