From 54bb2f74b5156b4251582842b0edc8e216958e01 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Tue, 30 Jan 2018 18:21:07 -0500 Subject: [PATCH] Add Rack::TempfileReaper to tests and docs --- guides/source/rails_on_rack.md | 5 +++++ railties/test/application/middleware_test.rb | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/guides/source/rails_on_rack.md b/guides/source/rails_on_rack.md index 6780e7c0de..1627205b7b 100644 --- a/guides/source/rails_on_rack.md +++ b/guides/source/rails_on_rack.md @@ -126,6 +126,7 @@ use ActionDispatch::ContentSecurityPolicy::Middleware use Rack::Head use Rack::ConditionalGet use Rack::ETag +use Rack::TempfileReaper run MyApp::Application.routes ``` @@ -300,6 +301,10 @@ Much of Action Controller's functionality is implemented as Middlewares. The fol * Adds ETag header on all String bodies. ETags are used to validate cache. +**`Rack::TempfileReaper`** + +* Cleans up tempfiles used to buffer multipart requests. + TIP: It's possible to use any of the above middlewares in your custom Rack stack. Resources diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb index d59384e982..b9e4a9ccc0 100644 --- a/railties/test/application/middleware_test.rb +++ b/railties/test/application/middleware_test.rb @@ -45,7 +45,8 @@ module ApplicationTests "ActionDispatch::ContentSecurityPolicy::Middleware", "Rack::Head", "Rack::ConditionalGet", - "Rack::ETag" + "Rack::ETag", + "Rack::TempfileReaper" ], middleware end @@ -69,7 +70,8 @@ module ApplicationTests "ActionDispatch::Callbacks", "Rack::Head", "Rack::ConditionalGet", - "Rack::ETag" + "Rack::ETag", + "Rack::TempfileReaper" ], middleware end