@@ -39,6 +39,7 class ApplicationController < ActionController::Base | |||
|
39 | 39 | |
|
40 | 40 | rescue_from ActionController::InvalidAuthenticityToken, :with => :invalid_authenticity_token |
|
41 | 41 | rescue_from ::Unauthorized, :with => :deny_access |
|
42 | rescue_from ::ActionView::MissingTemplate, :with => :missing_template | |
|
42 | 43 | |
|
43 | 44 | include Redmine::Search::Controller |
|
44 | 45 | include Redmine::MenuManager::MenuController |
@@ -352,13 +353,17 class ApplicationController < ActionController::Base | |||
|
352 | 353 | format.html { |
|
353 | 354 | render :template => 'common/error', :layout => use_layout, :status => @status |
|
354 | 355 | } |
|
355 |
format.a |
|
|
356 | format.xml { head @status } | |
|
357 | format.js { head @status } | |
|
358 | format.json { head @status } | |
|
356 | format.any { head @status } | |
|
359 | 357 | end |
|
360 | 358 | end |
|
361 | ||
|
359 | ||
|
360 | # Handler for ActionView::MissingTemplate exception | |
|
361 | def missing_template | |
|
362 | logger.warn "Missing template, responding with 404" | |
|
363 | @project = nil | |
|
364 | render_404 | |
|
365 | end | |
|
366 | ||
|
362 | 367 | # Filter for actions that provide an API response |
|
363 | 368 | # but have no HTML representation for non admin users |
|
364 | 369 | def require_admin_or_api_request |
General Comments 0
You need to be logged in to leave comments.
Login now