1
0
Fork 0
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:
Rafael França 2021-09-21 18:46:49 -04:00 committed by GitHub
commit 8f9f7e7ca4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View file

@ -3,6 +3,7 @@
require "rails/application_controller"
class Rails::WelcomeController < Rails::ApplicationController # :nodoc:
skip_forgery_protection
layout false
def index

View file

@ -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