def get_env_to_hide_service_bridge(wsgi_env):
    output = {}

    # Because the request is coming over the service bridge, the service bridge
    # host and port that are automatically populated in SERVER_NAME and
    # SERVER_PORT, respectively.  However, this is an implementation detail
    # that should not be shown to user code. Instead, we'll rely on the
    # HTTP Host header to retrieve the hostname used in the original request.
    # This mimics the behavior of non-VM App Engine.
    http_host = wsgi_env.get('HTTP_HOST', None)
    if http_host:
        output['SERVER_NAME'] = http_host

    # Similarly we'll use the HTTPS flag to determine the port used in the
    # original request.
    https = wsgi_env.get('HTTP_X_APPENGINE_HTTPS', 'off')
    if https == 'off':
        output['SERVER_PORT'] = '80'
    elif https == 'on':
        output['SERVER_PORT'] = '443'
    else:
        logging.warning(
            'Unrecognized value for HTTPS (%s), won\'t modify SERVER_PORT',
            https)

    return output
Test GenerateUrl method with 'HEAD' method on S3 object store.
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-vmruntime/vmruntime/middleware.py/get_env_to_hide_service_bridge--crossover with--dataset/ETHPy150Open viewfinderco/viewfinder/backend/storage/test/s3_object_store_test.py/S3ObjectStoreTestCase.testGenerateHeadUrl