Skip to content

Commit

Permalink
Sidekiq >= 6.2 requires a session middleware for CSRF protection (#339)
Browse files Browse the repository at this point in the history
Since sidekiq/sidekiq#4804 sidekiq requires to be configured explicitly with a rack session.
  • Loading branch information
marcelolx committed May 14, 2021
1 parent 41990aa commit e67a778
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/sidekiq-scheduler/web_spec.rb
Expand Up @@ -4,6 +4,8 @@
describe Sidekiq::Web do
include Rack::Test::Methods

Sidekiq::Web.use Rack::Session::Cookie, secret: File.read("spec/support/.session.key"), same_site: true, max_age: 86400

let(:app) { Sidekiq::Web }

let(:enabled_job_name) { 'Foo Job' }
Expand Down
1 change: 1 addition & 0 deletions spec/support/.session.key
@@ -0,0 +1 @@
12d2dc785301be134b61f32a5de2fc8a5102dc0aa25899736ff5f94be32c2148

0 comments on commit e67a778

Please sign in to comment.