Method: Addressable::URI#normalize
- Defined in:
- lib/addressable/uri.rb
#normalize ⇒ Addressable::URI
Returns a normalized URI object.
NOTE: This method does not attempt to fully conform to specifications. It exists largely to correct other people’s failures to read the specifications, and also to deal with caching issues since several different URIs may represent the same resource and should not be cached multiple times.
2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 |
# File 'lib/addressable/uri.rb', line 2153 def normalize # This is a special exception for the frequently misused feed # URI scheme. if normalized_scheme == "feed" if self.to_s =~ /^feed:\/*http:\/*/ return URI.parse( self.to_s[/^feed:\/*(http:\/*.*)/, 1] ).normalize end end return self.class.new( :scheme => normalized_scheme, :authority => , :path => normalized_path, :query => normalized_query, :fragment => normalized_fragment ) end |