Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #413 from whilefalse/master

Maintain query string parameters in test mode.
  • Loading branch information...
commit 43ef8d9b74cd20321e7945307c59b537787933b9 2 parents 95802bf + a20c0a9
@sferik sferik authored
View
2  oa-core/lib/omniauth/strategy.rb
@@ -95,7 +95,7 @@ def mock_request_call
elsif env['HTTP_REFERER'] && !env['HTTP_REFERER'].match(/#{request_path}$/)
@env['rack.session']['omniauth.origin'] = env['HTTP_REFERER']
end
- redirect(script_name + callback_path)
+ redirect(script_name + callback_path + query_string)
end
def mock_callback_call
View
5 oa-core/spec/omniauth/strategy_spec.rb
@@ -267,6 +267,11 @@ def make_env(path = '/auth/test', props = {})
strategy.call(make_env('/AUTH/TeSt/CaLlBAck')).should == strategy.call(make_env('/auth/test/callback'))
end
+ it 'should maintain query string parameters' do
+ response = strategy.call(make_env('/auth/test', 'QUERY_STRING' => 'cheese=stilton'))
+ response[1]['Location'].should == '/auth/test/callback?cheese=stilton'
+ end
+
it 'should not short circuit requests outside of authentication' do
strategy.call(make_env('/')).should == app.call(make_env('/'))
end
Please sign in to comment.
Something went wrong with that request. Please try again.