class Addressable::URI

def normalized_port

Returns:
  • (Integer) - The port component, normalized.
def normalized_port
  return nil unless self.port
  return @normalized_port unless @normalized_port == NONE
  @normalized_port = begin
    if URI.port_mapping[self.normalized_scheme] == self.port
      nil
    else
      self.port
    end
  end
end