Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

rack.input for generic_url_rewriter

#5029

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?

Reported by Aaron Gibralter · July 1st, 2010 @ 05:34 PM

State: stale
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Jeremy Kemper
    Jeremy Kemper
    • Importance changed from to Low

    'rack.input' => StringIO.new will do it. Patch + test welcome!

    July 1st, 2010 @ 05:39 PM

  2. Aaron Gibralter
    Aaron Gibralter

    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.

    July 1st, 2010 @ 05:53 PM

  3. Aaron Gibralter
  4. Bodaniel Jeanes
  5. Dave Sims
    Dave Sims

    Not just an issue with Cucumber -- it also affects url helpers on the console. 'app.foo_url' has the same problem.

    +1

    September 11th, 2010 @ 06:54 PM

  6. Randy Schmidt
  7. rails
    rails
    • 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.

    February 24th, 2011 @ 12:00 AM

  8. rails
    rails
    • State changed from open to stale

    February 24th, 2011 @ 12:00 AM