• Levente Bagi's avatar
    Fixes omniauth & rack-1.2 bug #1824 · 6e60d932
    Levente Bagi authored
    Rack 1.2's request.url method is buggy, as it gets the host part from
    HTTP_X_FORWARDED_HOST, but the port from SERVER_PORT (which should be
    used in conjuction with SERVER_ADDR).
    This way, if the app is run behind a reverse proxy, it will create a
    URL with <public_host>:<private port>, and pass this to Facebook,
    so Facebook will redirect back to the URL with the wrong port.
    Upgrading Rack requires upgrade to Rails 3.1.
    This temporary solution configures OmniAuth using a copy of the newer
    version of Rack::Request.
omniauth.rb 1.31 KB