我已经将我的应用程序从Rails 4.2.11.1升级到了Rails 5.2.3。现在,我假设所有与COR相关的选项都失败了。我已经在application.rb中注释掉了COR代码,但仍然失败。
# Open CORS for development
unless Rails.env.production?
config.middleware.insert_before 0, Rack::Cors, debug: true, logger: (-> { Rails.logger }) do
allow do
origins '*'
resource '/cors',
headers: :any,
methods: [:post],
credentials: false,
max_age: 600
resource '*',
headers: :any,
methods: [:get, :post, :delete, :put, :patch, :options, :head],
expose: ['access-token', 'expiry', 'token-type', 'uid', 'client', 'Total', 'Per-Page', 'Link'],
max_age: 600
end
end
end
end