def _getResourceForRequest(self, request):
        """(Internal) Get the appropriate resource for the given host.
        """
        hostHeader = request.getHeader(b'host')
        if hostHeader == None:
            return self.default or resource.NoResource()
        else:
            host = hostHeader.lower().split(b':', 1)[0]
        return (self.hosts.get(host, self.default)
                or resource.NoResource("host %s not in vhost map" % repr(host)))
(Internal) Get the appropriate resource for the given host.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/vhost.py