Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/needto/omniauth
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Bleigh committed Mar 1, 2011
2 parents fa3d257 + 648e5d2 commit 72425fd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Expand Up @@ -68,7 +68,7 @@ def get_service_response_body
http = Net::HTTP.new(@uri.host, @uri.port)
http.use_ssl = @uri.port == 443 || @uri.instance_of?(URI::HTTPS)
http.start do |c|
response = c.get "#{@uri.path}?#{@uri.query}", VALIDATION_REQUEST_HEADERS
response = c.get "#{@uri.path}?#{@uri.query}", VALIDATION_REQUEST_HEADERS.dup
result = response.body
end
result
Expand Down
19 changes: 19 additions & 0 deletions oa-enterprise/spec/omniauth/strategies/cas_spec.rb
Expand Up @@ -72,4 +72,23 @@ def strategy
last_response.body.should == 'true'
end
end

unless RUBY_VERSION =~ /^1\.8\.\d$/
describe 'GET /auth/cas/callback with a valid ticket and gzipped response from the server on ruby >1.8' do
before do
zipped = StringIO.new
Zlib::GzipWriter.wrap zipped do |io|
io.write File.read(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'cas_success.xml'))
end
stub_request(:get, /^https:\/\/cas.example.org(:443)?\/serviceValidate\?([^&]+&)?ticket=593af/).
with { |request| @request_uri = request.uri.to_s }.
to_return(:body => zipped.string, :headers => { 'content-encoding' => 'gzip' })
get '/auth/cas/callback?ticket=593af'
end

it 'should call through to the master app when response is gzipped' do
last_response.body.should == 'true'
end
end
end
end

0 comments on commit 72425fd

Please sign in to comment.