Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable forgery protection for ReceiveController #127

Merged
merged 1 commit into from
Jul 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/controllers/diaspora_federation/receive_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
module DiasporaFederation
# This controller processes receiving messages.
class ReceiveController < ApplicationController
skip_forgery_protection

# Receives public messages
#
# POST /receive/public
Expand Down
6 changes: 5 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@
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
Expand Down