rubycas / rubycas-client-rails

Rails plugin for the RubyCAS-Client
MIT License
77 stars 70 forks source link

private method `gsub' called for nil:NilClass #20

Closed CloCkWeRX closed 12 years ago

CloCkWeRX commented 12 years ago

In 2.3.9, under some circumstances it's possible to trigger the above error.

A NoMethodError occurred in agc#logout:

private method gsub' called for nil:NilClass /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/1.8/cgi.rb:342:inescape' vendor/bundle/ruby/1.8/gems/rubycas-client-2.3.9/lib/casclient/client.rb:285:in hash_to_query' vendor/bundle/ruby/1.8/gems/rubycas-client-2.3.9/lib/casclient/client.rb:285:ineach' vendor/bundle/ruby/1.8/gems/rubycas-client-2.3.9/lib/casclient/client.rb:285:in hash_to_query' vendor/bundle/ruby/1.8/gems/rubycas-client-2.3.9/lib/casclient/client.rb:283:ineach' vendor/bundle/ruby/1.8/gems/rubycas-client-2.3.9/lib/casclient/client.rb:283:in hash_to_query' vendor/bundle/ruby/1.8/gems/rubycas-client-2.3.9/lib/casclient/client.rb:96:inlogout_url' vendor/gems/rubycas-client-rails/lib/rubycas-client-rails.rb:234:in logout' lib/ruby_cas_proxy.rb:9:inlogout' app/controllers/agc/agc_controller.rb:13:in `logout'

It looks like https://github.com/rubycas/rubycas-client/blob/v2.3.9/lib/casclient/client.rb#L281 is somehow getting a destination_url which, when parsed, has Nil elements.

Users are typically coming from URIs like: https://foo.com/path/to/page?&sort=date_received.DESC

CloCkWeRX commented 12 years ago

... and of course it works for 1.9.3, not 1.8.7

CloCkWeRX commented 12 years ago

Oops, this is meant to be on ruby-casclient