def _getHost(self, bytes):
        """
        Retrieve the value of the I{Host} header from the serialized
        request given by C{bytes}.
        """
        for line in bytes.split(b'\r\n'):
            try:
                name, value = line.split(b':', 1)
                if name.strip().lower() == b'host':
                    return value.strip()
            except ValueError:
                pass

        Retrieve the value of the I{Host} header from the serialized
        request given by C{bytes}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_webclient.py