Commit 48a5460d authored by Eric Davis's avatar Eric Davis

Allow js formatted responses.

Otherwise they return the invalid format error (406) instead of 403, 404, or 500

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3827 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent bd1384db
...@@ -130,6 +130,7 @@ class ApplicationController < ActionController::Base ...@@ -130,6 +130,7 @@ class ApplicationController < ActionController::Base
format.html { redirect_to :controller => "account", :action => "login", :back_url => url } format.html { redirect_to :controller => "account", :action => "login", :back_url => url }
format.atom { redirect_to :controller => "account", :action => "login", :back_url => url } format.atom { redirect_to :controller => "account", :action => "login", :back_url => url }
format.xml { head :unauthorized, 'WWW-Authenticate' => 'Basic realm="Redmine API"' } format.xml { head :unauthorized, 'WWW-Authenticate' => 'Basic realm="Redmine API"' }
format.js { head :unauthorized, 'WWW-Authenticate' => 'Basic realm="Redmine API"' }
format.json { head :unauthorized, 'WWW-Authenticate' => 'Basic realm="Redmine API"' } format.json { head :unauthorized, 'WWW-Authenticate' => 'Basic realm="Redmine API"' }
end end
return false return false
...@@ -240,6 +241,7 @@ class ApplicationController < ActionController::Base ...@@ -240,6 +241,7 @@ class ApplicationController < ActionController::Base
format.html { render :template => "common/403", :layout => (request.xhr? ? false : 'base'), :status => 403 } format.html { render :template => "common/403", :layout => (request.xhr? ? false : 'base'), :status => 403 }
format.atom { head 403 } format.atom { head 403 }
format.xml { head 403 } format.xml { head 403 }
format.js { head 403 }
format.json { head 403 } format.json { head 403 }
end end
return false return false
...@@ -250,6 +252,7 @@ class ApplicationController < ActionController::Base ...@@ -250,6 +252,7 @@ class ApplicationController < ActionController::Base
format.html { render :template => "common/404", :layout => !request.xhr?, :status => 404 } format.html { render :template => "common/404", :layout => !request.xhr?, :status => 404 }
format.atom { head 404 } format.atom { head 404 }
format.xml { head 404 } format.xml { head 404 }
format.js { head 404 }
format.json { head 404 } format.json { head 404 }
end end
return false return false
...@@ -263,6 +266,7 @@ class ApplicationController < ActionController::Base ...@@ -263,6 +266,7 @@ class ApplicationController < ActionController::Base
} }
format.atom { head 500 } format.atom { head 500 }
format.xml { head 500 } format.xml { head 500 }
format.js { head 500 }
format.json { head 500 } format.json { head 500 }
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment