Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/casclient/responses.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ def initialize(http_response = nil, options={})
def parse_http_response(http_response)
header = http_response.to_hash

# FIXME: this regexp might be incorrect...

if header['set-cookie'] &&
header['set-cookie'].first &&
header['set-cookie'].first =~ /tgt=([^&]+);/
header['set-cookie'].first =~ /tgt=([^&]+)/
@tgt = $~[1]
end

Expand All @@ -191,7 +191,7 @@ def parse_http_response(http_response)
@ticket = $~[1]
end

if not ((http_response.kind_of?(Net::HTTPSuccess) || http_response.kind_of?(Net::HTTPFound)) && @ticket.present?)
if not ((http_response.kind_of?(Net::HTTPSuccess) || http_response.kind_of?(Net::HTTPFound) || http_response.kind_of?(Net::HTTPSeeOther)) && @ticket.present?)
@failure = true
# Try to extract the error message -- this only works with RubyCAS-Server.
# For other servers we just return the entire response body (i.e. the whole error page).
Expand Down