Changeset 8929
- Timestamp:
- 02/25/08 21:04:02 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/open_id_authentication/lib/open_id_authentication.rb
r8476 r8929 58 58 59 59 def self.normalize_url(url) 60 begin 61 uri = URI.parse(url) 62 uri = URI.parse("http://#{uri}") unless uri.scheme 63 uri.scheme = uri.scheme.downcase # URI should do this 64 uri.normalize.to_s 65 rescue URI::InvalidURIError 66 raise InvalidOpenId.new("#{url} is not an OpenID URL") 67 end 60 uri = URI.parse(url.strip) 61 uri = URI.parse("http://#{uri}") unless uri.scheme 62 uri.scheme = uri.scheme.downcase # URI should do this 63 uri.normalize.to_s 64 rescue URI::InvalidURIError 65 raise InvalidOpenId.new("#{url} is not an OpenID URL") 68 66 end 69 67 plugins/open_id_authentication/test/normalize_test.rb
r7214 r8929 21 21 "http://loudthinking.com:8080" => "http://loudthinking.com:8080/", 22 22 "techno-weenie.net" => "http://techno-weenie.net/", 23 "http://techno-weenie.net" => "http://techno-weenie.net/" 23 "http://techno-weenie.net" => "http://techno-weenie.net/", 24 "http://techno-weenie.net " => "http://techno-weenie.net/" 24 25 } 25 26