diff --git a/lib/omniauth/strategy.rb b/lib/omniauth/strategy.rb index fcd8e65..88aebc8 100644 --- a/lib/omniauth/strategy.rb +++ b/lib/omniauth/strategy.rb @@ -237,9 +237,6 @@ module OmniAuth def mock_request_call setup_phase - if response = call_through_to_app - return response - end if request.params['origin'] @env['rack.session']['omniauth.origin'] = request.params['origin'] @@ -356,14 +353,6 @@ module OmniAuth request.query_string.empty? ? "" : "?#{request.query_string}" end - def call_through_to_app - status, headers, body = *call_app! - session['query_params'] = Rack::Request.new(env).params - @response = Rack::Response.new(body, status, headers) - - status == 404 ? nil : @response.finish - end - def call_app!(env = @env) @app.call(env) end diff --git a/spec/omniauth/strategy_spec.rb b/spec/omniauth/strategy_spec.rb index 01f10bc..41e71fa 100644 --- a/spec/omniauth/strategy_spec.rb +++ b/spec/omniauth/strategy_spec.rb @@ -477,6 +477,11 @@ describe OmniAuth::Strategy do end context 'test mode' do + let(:app) do + # In test mode, the underlying app shouldn't be called on request phase. + lambda { |env| [404, {"Content-Type" => "text/html"}, []] } + end + before do OmniAuth.config.test_mode = true end