Michael Bleigh
2011-Apr-26 00:01 UTC
Rack Environment Modification Problems on Multiple Calls?
Taken from https://github.com/intridea/omniauth/issues/239 - I''m not
sure
what the issue might be here, wondering if someone on Rails core might know
why this behavior is happening.
It seems that it''s even easier to reproduce. If you call the following
line
in a before_filter:
request.env[''warden''].authenticate(:scope => :user)
and add a middleware looking like this (to simulate OmniAuth strategy that
calls app twice, each time with different env):
class Kaboom
def initialize(app)
@app = app
end
def call(env)
@app.call(env.dup) # call 1
@app.call(env) # call 2
end
end
Then `params[:controller]` and `params[:action]` are missing in every
request.
If you remove the before filter __or__ change the first call in the
middleware to `@app.call(env)` (without .dup) it works fine.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-core+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en.