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

Possible to avoid adding Rack::MethodOverride middleware to main app? #207

Closed
mintuhouse opened this issue Nov 18, 2024 · 3 comments
Closed

Comments

@mintuhouse
Copy link

mintuhouse commented Nov 18, 2024

In our API only rails app, we use Rack::RewindableInput::Middleware for one of the engines
Adding Rack::MethodOverride to main app breaks this engine
Can we add the middleware just for the MissionControl::Jobs::Engine?

SO post explains the issue

@mintuhouse mintuhouse changed the title Possible to avoid adding Rack::MethodOverride middleware to app? Possible to avoid adding Rack::MethodOverride middleware to main app? Nov 19, 2024
@rosa
Copy link
Member

rosa commented Nov 25, 2024

Oops, @mintuhouse, sorry about this! Last week I was on-call and couldn't pay a lot of attention to this repo. Is this not an issue anymore? I think adding the middleware so that it only affects Mission Control should be possible, I just haven't looked into it.

@mintuhouse mintuhouse reopened this Nov 25, 2024
@mintuhouse
Copy link
Author

mintuhouse commented Nov 25, 2024

Sorry! Some linear rule at work closed this issue too when we pushed a workaround for this.

# config/initializers/mission_control.rb
Rails.application.config.middleware.delete(Rack::MethodOverride)
Rails.application.config.middleware.delete(ActionDispatch::Flash)
MissionControl::Jobs::Engine.config.middleware.use(ActionDispatch::Flash)
MissionControl::Jobs::Engine.config.middleware.use(Rack::MethodOverride)

We are unblocked for now

@rosa
Copy link
Member

rosa commented Nov 25, 2024

Ohhh, haha! Thanks for letting me know! I'll do that same change actually 😅

@rosa rosa closed this as completed in a3f9594 Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants