code: def get_canonical_host(self):
          
          host = self.host.lower()
          if self.port is not None:
              host = "%s:%s" % (host, self.port)
          return host
docs: Return the canonical host as for the Host HTTP header specification.