mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Fix a problem with IE7 headers.
This commit is contained in:
parent
f49efdff13
commit
835d1044ae
3 changed files with 11 additions and 3 deletions
|
@ -170,7 +170,7 @@ module Devise
|
|||
|
||||
# Which formats should be treated as navigational.
|
||||
mattr_accessor :navigational_formats
|
||||
@@navigational_formats = [:html]
|
||||
@@navigational_formats = [:"*/*", :html]
|
||||
|
||||
# When set to true, signing out an user signs out all other scopes.
|
||||
mattr_accessor :sign_out_all_scopes
|
||||
|
|
|
@ -141,9 +141,12 @@ Devise.setup do |config|
|
|||
# Lists the formats that should be treated as navigational. Formats like
|
||||
# :html, should redirect to the sign in page when the user does not have
|
||||
# access, but formats like :xml or :json, should return 401.
|
||||
#
|
||||
# If you have any extra navigational formats, like :iphone or :mobile, you
|
||||
# should add them to the navigational formats lists. Default is [:html]
|
||||
# config.navigational_formats = [:html, :iphone]
|
||||
# should add them to the navigational formats lists.
|
||||
#
|
||||
# The :"*/*" format below is required to match Internet Explorer requests.
|
||||
# config.navigational_formats = [:"*/*", :html]
|
||||
|
||||
# The default HTTP method used to sign out a resource. Default is :get.
|
||||
# config.sign_out_via = :get
|
||||
|
|
|
@ -28,6 +28,11 @@ class FailureTest < ActiveSupport::TestCase
|
|||
assert_equal 302, @response.first
|
||||
end
|
||||
|
||||
test 'return 302 status for wildcard requests' do
|
||||
call_failure 'action_dispatch.request.formats' => nil, 'HTTP_ACCEPT' => '*/*'
|
||||
assert_equal 302, @response.first
|
||||
end
|
||||
|
||||
test 'return to the default redirect location' do
|
||||
call_failure
|
||||
assert_equal 'You need to sign in or sign up before continuing.', @request.flash[:alert]
|
||||
|
|
Loading…
Reference in a new issue