def application_uri(environ):
    url = environ['wsgi.url_scheme']+'://'
    from urllib import quote

    if environ.get('HTTP_HOST'):
        url += environ['HTTP_HOST']
    else:
        url += environ['SERVER_NAME']

        if environ['wsgi.url_scheme'] == 'https':
            if environ['SERVER_PORT'] != '443':
                url += ':' + environ['SERVER_PORT']
        else:
            if environ['SERVER_PORT'] != '80':
                url += ':' + environ['SERVER_PORT']

    url += quote(environ.get('SCRIPT_NAME') or '/')
    return url
Read all messages from the queue and persist them to local file.
dataset/ETHPy150Open CollabQ/CollabQ/vendor/wsgiref/util.py/application_uri--crossover with--dataset/ETHPy150Open darcyliu/storyboard/boto/sqs/queue.py/Queue.save_to_filename