遇到一个奇怪的问题,其中Rack::ShowExceptions
正在为我的rails 4.0.4应用程序在生产环境中渲染详细的异常。添加一个config.middleware.delete(Rack::ShowExceptions)
到config/application.rb
仍然设法导致Rack::ShowExceptions
template被渲染,因此我期望有一些中间件依赖潜伏。在生产环境中启用Rack :: ShowExceptions Rails 4.0.4
例如,击中未逸出%
该应用在POST
请求引线接Rack::ShowExceptions
模板被呈现:
样品无效POST
请求:
POST /en/users/sign_in HTTP/1.1
Host: www.localhost.dev
Proxy-Connection: keep-alive
Content-Length: 1
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Origin: http://www.localhost.dev
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip,deflate
Accept-Language: en-US,en;q=0.8
%
Rack中间件:
$ RAILS_ENV=production rake middleware
use Raven::Rack
use HttpMethodNotAllowed
use ActionDispatch::SSL
use Rack::Sendfile
use ActionDispatch::Static
use #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x007feba5b8b940>
use Rack::Runtime
use Rack::MethodOverride
use ActionDispatch::RequestId
use RequestStore::Middleware
use Rails::Rack::Logger
use ActionDispatch::ShowExceptions
use ActionDispatch::DebugExceptions
use ActionDispatch::RemoteIp
use ActionDispatch::Callbacks
use ActiveRecord::ConnectionAdapters::ConnectionManagement
use ActiveRecord::QueryCache
use ActionDispatch::Cookies
use ActionDispatch::Session::CookieStore
use ActionDispatch::Flash
use ActionDispatch::ParamsParser
use Rack::Head
use Rack::ConditionalGet
use Rack::ETag
use Warden::Manager
run MyApplication::Application.routes
我们有config.exceptions_add = self.routes
在config/application.rb
if这是相关的。
我给了ActionPack CHANGELOG一个非常接近的阅读,但很可能这个问题已经在以后的版本中修复!如果是这样,我将非常感谢提及它。