def health_check_middleware(app):
    """Intercept requests to /_ah/health and respond healthy (200 OK).

    Args:
        app: The WSGI app to wrap.

    Returns:
        The wrapped app, also a WSGI app.
    """

    @wrappers.Request.application
    def health_check_intercept_wrapper(request):
        """Capture a request to /_ah/health and respond with 200 OK."""
        if request.path == '/_ah/health':  # Only intercept exact matches.
            return wrappers.Response('healthy', status=httplib.OK)
        else:
            return app

    return health_check_intercept_wrapper
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-vmruntime/vmruntime/middleware.py/health_check_middleware/original