@property
    def host(self):
        """Return the host"""
        if 'HTTP_X_FORWARDED_HOST' in self.environ:
            return self.environ['HTTP_X_FORWARDED_HOST']
        elif 'HTTP_HOST' in self.environ:
            return self.environ['HTTP_HOST']
        result = environ['SERVER_NAME']
        if (environ['wsgi.url_schema'], environ['SERVER_ROOT']) not \
            in (('https', '443'), ('http', '80')):
            result += ':' + environ['SERVER_PORT']
        return result
dataset/ETHPy150Open fengsp/batpod/exts/http.py/Request.host/original