Skip to content
Browse files

rubycas-client: follow redirections in requests to the CAS server

  • Loading branch information...
1 parent 127a0a3 commit 64435e1a5492296fd6e3a31fcb13d7d1989bb634 @nackd nackd committed Oct 20, 2010
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/casclient/client.rb
View
3 lib/casclient/client.rb
@@ -214,6 +214,9 @@ def request_cas_response(uri, type)
raw_res = https.start do |conn|
conn.get("#{uri.path}?#{uri.query}")
end
+ while Net::HTTPRedirection === raw_res
+ raw_res = Net::HTTP.get_response(URI.parse(raw_res['location']))
+ end
rescue Errno::ECONNREFUSED => e
log.error "CAS server did not respond! (#{e.inspect})"
raise "The CAS authentication server at #{uri} is not responding!"

0 comments on commit 64435e1

Please sign in to comment.
Something went wrong with that request. Please try again.