This project is archived and is in readonly mode.
rack.input for generic_url_rewriter
Reported by Aaron Gibralter | July 1st, 2010 @ 05:34 PM
So I don't know where this problem should be solved... but there is an issue when using Rails 2.3.8 (and thus Rack 1.1.0) with Cucumber and Facebooker. Facebooker adds some functionality to the Rails URL rewriter and tries to acess the @request.request_parameters (which Rails forwards to Rack's POST method) during rewrite_url_with_facebooker: http://github.com/mmangino/facebooker/blob/master/lib/facebooker/ra.... This causes a problem in Cucumber step definitions, however, because Cucumber step definitions use Rails's generic_url_rewriter defined in actionpack's integration.rb: http://github.com/rails/rails/blob/v2.3.8/actionpack/lib/action_con.... Rack 1.1.0 requires that env["rack.input"] exists when trying to check the POST params: http://github.com/rack/rack/blob/master/lib/rack/request.rb#L148. This causes all my cucumber features to explode. Would it make sense to adjust actionpack's generic_url_rewriter to include a "rack.input" in the env? This solves the problem, but I don't know if it's the appropriate solution.
env = {
'REQUEST_METHOD' => "GET",
'QUERY_STRING' => "",
"REQUEST_URI" => "/",
"HTTP_HOST" => host,
"SERVER_PORT" => https? ? "443" : "80",
"HTTPS" => https? ? "on" : "off",
"rack.input" => "...?"
}
Also, I'm not sure what generic_url_rewriter should use for "rack.input".
Any thoughts?
Comments and changes to this ticket
-
Jeremy Kemper July 1st, 2010 @ 05:39 PM
- Importance changed from to Low
'rack.input' => StringIO.new
will do it. Patch + test welcome! -
Aaron Gibralter July 1st, 2010 @ 05:53 PM
Happy to patch, but I'm not so sure where a test would go... This seems like it would be more of an integration test of integration.rb.
-
Aaron Gibralter July 1st, 2010 @ 06:15 PM
How is something like this: http://github.com/agibralter/rails/commit/d18336875d0fd0b4249f83c15...
-
Dave Sims September 11th, 2010 @ 06:54 PM
Not just an issue with Cucumber -- it also affects url helpers on the console. 'app.foo_url' has the same problem.
+1
-
rails February 24th, 2011 @ 12:00 AM
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
rails February 24th, 2011 @ 12:00 AM
- State changed from open to stale
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>