遇到一個奇怪的問題,其中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一個非常接近的閱讀,但很可能這個問題已經在以後的版本中修復!如果是這樣,我將非常感謝提及它。