On Wednesday, October 3, 2012 2:11:33 PM UTC+1, jcoleman wrote: > > Is there a way to disable certain middleware based on the route? Part of > my application is an API that shouldn't really ever be sending 304's while > I'm fine with the web application doing that. It seems like removing > Rack::ConditionalGet should eliminate the setting of the 304 when the ETags > match, but I don't see a way in the documentation to remove middleware > non-globally.
I don't think so, at least not without splitting out your api into an engine which would then (IIRC - engines aren't something I've really used) have its own middleware stack. It should however be relatively easy to write your own middleware which, depending on the path, either calls through to the next item in the stack or invokes the Rack::Etag stuff and then replace the Rack::Etag middleware with that Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/4GrTZSJ9QQ8J. For more options, visit https://groups.google.com/groups/opt_out.

