class Addressable::URI

def normalize

Returns:
  • (Addressable::URI) - The normalized URI.
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 => normalized_authority,
    :path => normalized_path,
    :query => normalized_query,
    :fragment => normalized_fragment
  )
end