Disable forgery protection for ReceiveController
This is enabled by default since rails 5.2, but it doesn't make sense for the /receive/ routes, because they are called without a session and without a token.
This commit is contained in:
parent
15465bf46a
commit
8a8678c97b
2 changed files with 7 additions and 1 deletions
|
|
@ -5,6 +5,8 @@ require_dependency "diaspora_federation/application_controller"
|
|||
module DiasporaFederation
|
||||
# This controller processes receiving messages.
|
||||
class ReceiveController < ApplicationController
|
||||
skip_forgery_protection
|
||||
|
||||
# Receives public messages
|
||||
#
|
||||
# POST /receive/public
|
||||
|
|
|
|||
|
|
@ -50,7 +50,11 @@ RSpec.configure do |config|
|
|||
expect_config.syntax = :expect
|
||||
end
|
||||
|
||||
unless defined?(::Rails)
|
||||
if defined?(::Rails)
|
||||
config.before(:each, type: :controller) do
|
||||
ActionController::Base.allow_forgery_protection = true
|
||||
end
|
||||
else
|
||||
config.exclude_pattern = "**/controllers/**/*_spec.rb, **/routing/**/*_spec.rb"
|
||||
config.filter_run_excluding rails: true
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue