steveklabnik / request_store

Per-request global storage for Rack.
https://github.com/steveklabnik/request_store
MIT License
1.47k stars 87 forks source link

How to not insert RequestStore::Middleware ? #55

Closed lawrencepit closed 6 years ago

lawrencepit commented 7 years ago

In a rails app RequestStore::Middleware is automatically inserted after ActionDispatch::RequestId. We have middleware before that which, in its ensure block, wants to access values from the RequestStore that were set in the app. The RequestStore::Middleware however in it ensure block clears everything. Is there a clean way to either prevent RequestStore::Middleware from being inserted automatically in the middleware stack or have it sit earlier in the stack?

steveklabnik commented 6 years ago

Hey @lawrencepit ; sorry I never replied to this issue. I'm going to assume that you either figured it out or didn't use this gem, so i'm going to give it a close.