简体   繁体   中英

Delayed_Job on Heroku showing “Forbidden” error

I am using delayed_job gem on a heroku deployment. It has been working fine for a few months, but suddenly when I try to access to access mydomain.com/delayed_job it shows one word: "Forbidden"

When I check heroku logs it doesn't show an error, but does show that the page was requested.

Any idea why this would happen? It is especially confusing since it has been working fine until now.

In the end I tried accessing the same page in a different browser and it works. Therefore the error likely has something to do with the local browser cache.

I had this too; it seems to be similar to the problem described in this issue . The CSRF protection gets false positives.

In my case, I only use DelayedWebAdmin in development, so I created an initializer to disable session protection. This would probably be a bad idea in production, but here's how to disable it in development:

config/initializers/delayed_job_web.rb :

if Rails.env.development?
    class DelayedJobWeb
        disable :sessions
        set :protection, false
    end
end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM