Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

`@request.request_parameters` blows up if there is no env["rack.input…

…"] as of rack-1.1.0. I'm assuming that since request_parameters is an alias (in actionpack) for rack's POST, we can safely assume that link_to_canvas? is false if we're not handling a POST request. This solves the blowing up problem when cucumber step definitions try to generate URLs (Rails 2.3.8 + Rack 1.0.0 + Facebooker + Cucumber + Capybara).
  • Loading branch information...
commit df80a7a511aafc78c38e3428556f70a4f3bb2d31 1 parent 7a2cd19
@agibralter agibralter authored mmangino committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/facebooker/rails/facebook_url_rewriting.rb
2  lib/facebooker/rails/facebook_url_rewriting.rb
@@ -44,7 +44,7 @@ def can_safely_access_request_parameters?
def rewrite_url_with_facebooker(*args)
options = args.first.is_a?(Hash) ? args.first : args.last
- is_link_to_canvas = link_to_canvas?(@request.request_parameters, options)
+ is_link_to_canvas = @request.env["REQUEST_METHOD"] == "POST" && link_to_canvas?(@request.request_parameters, options)
if is_link_to_canvas && !options.has_key?(:host)
options[:host] = Facebooker.canvas_server_base
Please sign in to comment.
Something went wrong with that request. Please try again.