def _get_url(self, scope, default_scheme, host):
    '\n        Extract URL from the ASGI scope, without also including the querystring.\n        '
    scheme = scope.get('scheme', default_scheme)
    server = scope.get('server', None)
    path = (scope.get('root_path', '') + scope.get('path', ''))
    if host:
        return ('%s://%s%s' % (scheme, host, path))
    if (server is not None):
        (host, port) = server
        default_port = {'http': 80, 'https': 443, 'ws': 80, 'wss': 443}[scheme]
        if (port != default_port):
            return ('%s://%s:%s%s' % (scheme, host, port, path))
        return ('%s://%s%s' % (scheme, host, path))
    return path
Extract URL from the ASGI scope, without also including the querystring.
def _get_url(self, scope, default_scheme, host):
    '\n        \n        '
    scheme = scope.get('scheme', default_scheme)
    server = scope.get('server', None)
    path = (scope.get('root_path', ) + scope.get('path', ))
    if host:
        return ('%s://%s%s' % (scheme, host, path))
    if (server is not None):
        (host, port) = server
        default_port = {'http': 80, 'https': 443, 'ws': 80, 'wss': 443}[scheme]
        if (port != default_port):
            return ('%s://%s:%s%s' % (scheme, host, port, path))
        return ('%s://%s%s' % (scheme, host, path))
    return path