mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
use class to specify the middleware [ci skip]
using string for middleware class names is deprecated in 83b767cef9
This commit is contained in:
parent
9db73a2591
commit
70b09eda03
2 changed files with 6 additions and 6 deletions
|
@ -171,7 +171,7 @@ Add the following lines to your application configuration:
|
|||
|
||||
```ruby
|
||||
# config/application.rb
|
||||
config.middleware.delete "Rack::Lock"
|
||||
config.middleware.delete Rack::Lock
|
||||
```
|
||||
|
||||
And now if you inspect the middleware stack, you'll find that `Rack::Lock` is
|
||||
|
@ -191,16 +191,16 @@ If you want to remove session related middleware, do the following:
|
|||
|
||||
```ruby
|
||||
# config/application.rb
|
||||
config.middleware.delete "ActionDispatch::Cookies"
|
||||
config.middleware.delete "ActionDispatch::Session::CookieStore"
|
||||
config.middleware.delete "ActionDispatch::Flash"
|
||||
config.middleware.delete ActionDispatch::Cookies
|
||||
config.middleware.delete ActionDispatch::Session::CookieStore
|
||||
config.middleware.delete ActionDispatch::Flash
|
||||
```
|
||||
|
||||
And to remove browser related middleware,
|
||||
|
||||
```ruby
|
||||
# config/application.rb
|
||||
config.middleware.delete "Rack::MethodOverride"
|
||||
config.middleware.delete Rack::MethodOverride
|
||||
```
|
||||
|
||||
### Internal Middleware Stack
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
# Read more: https://github.com/cyu/rack-cors
|
||||
|
||||
# Rails.application.config.middleware.insert_before 0, "Rack::Cors" do
|
||||
# Rails.application.config.middleware.insert_before 0, Rack::Cors do
|
||||
# allow do
|
||||
# origins 'example.com'
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue