Changeset 6334
- Timestamp:
- 03/05/07 03:05:41 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/open_id_authentication/lib/open_id_authentication.rb
r6331 r6334 40 40 end 41 41 42 def self.normalize_url(url) 43 url = url.downcase 44 45 case url 46 when %r{^https?://[^/]+/[^/]*} 47 url # already normalized 48 when %r{^https?://[^/]+$} 49 url + "/" 50 when %r{^[.\d\w]+/.*$} 51 "http://" + url 52 when %r{^[.\d\w]+$} 53 "http://" + url + "/" 54 else 55 raise "Unable to normalize: #{url}" 56 end 57 end 58 42 59 43 60 protected 44 61 def normalize_url(url) 45 url = url.downcase 46 47 case url 48 when %r{^https?://[^/]+/[^/]*} 49 url # already normalized 50 when %r{^https?://[^/]+$} 51 url + "/" 52 when %r{^[.\d\w]+/.*$} 53 "http://" + url 54 when %r{^[.\d\w]+$} 55 "http://" + url + "/" 56 else 57 raise "Unable to normalize: #{url}" 58 end 62 OpenIdAuthentication.normalize_url(url) 59 63 end 60 64 … … 114 118 def open_id_redirect_url(open_id_response) 115 119 open_id_response.redirect_url( 116 request.protocol + request.host ,120 request.protocol + request.host_with_port + "/", 117 121 open_id_response.return_to("#{request.url}?open_id_complete=1") 118 122 )