rubycas / rubycas-client

Ruby client for Yale's Central Authentication Service protocol -- an open source enterprise single sign on system for web applications.
http://code.google.com/p/rubycas-client/
Other
332 stars 217 forks source link

invalid byte sequence in UTF-8 #82

Open kaisersly opened 10 years ago

kaisersly commented 10 years ago

I received this error : CASClient::BadResponseException MALFORMED CAS RESPONSE when trying to connect to my CAS server.

I presume it's the server fault but since i can't modify it i had to monkey-patch the casclient/responses.rb to make this change :

def check_and_parse_xml(raw_xml)
    raw_xml = raw_xml.encode('UTF-8', :invalid => :replace, :undef => :replace, :replace => '?')
    ...
end

Is there a cleaner way to do it ?