diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-03-14 15:00:45 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-03-14 15:00:45 +0000 |
commit | fa0cdb7515fd6a355c5d29390afa257f06104522 (patch) | |
tree | 8684a17e1cb314d34d9115172483138140d13b15 | |
parent | a17effa95b4e315e047e4460478217fe6776fe4f (diff) | |
download | redmine-fa0cdb7515fd6a355c5d29390afa257f06104522.tar.gz redmine-fa0cdb7515fd6a355c5d29390afa257f06104522.zip |
Merged r14069 (#19325).
git-svn-id: http://svn.redmine.org/redmine/branches/3.0-stable@14091 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/controllers/application_controller.rb | 5 | ||||
-rw-r--r-- | test/integration/application_test.rb | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 480dfb885..e52cc6186 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -243,10 +243,13 @@ class ApplicationController < ActionController::Base redirect_to :controller => "account", :action => "login", :back_url => url end } - format.atom { redirect_to :controller => "account", :action => "login", :back_url => url } + format.any(:atom, :pdf, :csv) { + redirect_to :controller => "account", :action => "login", :back_url => url + } 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.any { head :unauthorized } end return false end diff --git a/test/integration/application_test.rb b/test/integration/application_test.rb index befb8fb35..e01b44a72 100644 --- a/test/integration/application_test.rb +++ b/test/integration/application_test.rb @@ -87,4 +87,11 @@ class ApplicationTest < Redmine::IntegrationTest ensure ActionController::Base.allow_forgery_protection = false end + + def test_require_login_with_pdf_format_should_not_error + with_settings :login_required => '1' do + get '/issues/1.pdf' + assert_response 302 + end + end end |