class Addressable::URI
def normalized_password
-
(String)
- The password component, normalized.
def normalized_password return nil unless self.password return @normalized_password if defined?(@normalized_password) @normalized_password ||= begin if self.normalized_scheme =~ /https?/ && self.password.strip.empty? && (!self.user || self.user.strip.empty?) nil else Addressable::URI.normalize_component( self.password.strip, Addressable::URI::CharacterClasses::UNRESERVED ) end end # All normalized values should be UTF-8 if @normalized_password @normalized_password.force_encoding(Encoding::UTF_8) end @normalized_password end