我使用Devise token_authentication服務和ActiveResource客戶端。我希望自動設置:每個請求中的auth_token參數!使用Rack中間件在每個請求上添加api_key
我想這一點,但是這並不工作...
class AuthApp
def initialize(app)
@app = app
end
def call(env)
status, headers, response = @app.call(env)
request = Rack::Request.new(env)
request.params[:auth_token] = 'jCxKPj8wJJdOnQJB8ERy'
[status, headers, response]
end
end
任何想法?
我有完全相同的問題。事實上,我曾在Rails 3.0.7和較舊版本的Rack中工作。現在,壞了。我可以在Rack應用程序中看到新合併的參數在那裏,但是他們並沒有爲乘坐Rails而閒逛。 – 2011-09-16 18:48:23