mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #42864 from hahmed/ha/new-rails-api-app-errors-on-welcome-controller
Fixes DisabledSessionError with new rails api app
This commit is contained in:
commit
8f9f7e7ca4
2 changed files with 14 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
require "rails/application_controller"
|
||||
|
||||
class Rails::WelcomeController < Rails::ApplicationController # :nodoc:
|
||||
skip_forgery_protection
|
||||
layout false
|
||||
|
||||
def index
|
||||
|
|
|
@ -734,5 +734,18 @@ module ApplicationTests
|
|||
get "/url"
|
||||
assert_equal "/foo", last_response.body
|
||||
end
|
||||
|
||||
test "request to rails/welcome for api_only app is successful" do
|
||||
add_to_config <<-RUBY
|
||||
config.api_only = true
|
||||
config.action_dispatch.show_exceptions = false
|
||||
config.action_controller.allow_forgery_protection = true
|
||||
RUBY
|
||||
|
||||
app "development"
|
||||
|
||||
get "/"
|
||||
assert_equal 200, last_response.status
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue