This project is archived and is in readonly mode.

#5029 ✓stale
Aaron Gibralter

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

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>

Pages