示例#1
0
文件: base.py 项目: berlinonline/ckan
    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # WSGIController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        try:
            res = WSGIController.__call__(self, environ, start_response)
        finally:
            model.Session.remove()

        check_session_cookie(response)

        return res
示例#2
0
文件: base.py 项目: mattcen/ckan
    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # WSGIController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        try:
            res = WSGIController.__call__(self, environ, start_response)
        finally:
            model.Session.remove()

        check_session_cookie(response)

        return res
示例#3
0
def ckan_after_request(response):
    u'''Common handler executed after all Flask requests'''

    # Check session cookie
    response = check_session_cookie(response)

    # Set CORS headers if necessary
    response = set_cors_headers_for_response(response)

    return response
示例#4
0
def ckan_after_request(response):
    u'''Common handler executed after all Flask requests'''

    # Check session cookie
    response = check_session_cookie(response)

    # Set CORS headers if necessary
    response = set_cors_headers_for_response(response)

    return response
示例#5
0
def ckan_after_request(response):
    u'''Common handler executed after all Flask requests'''

    # Dispose of the SQLALchemy session
    model.Session.remove()

    # Check session cookie
    response = check_session_cookie(response)

    # Set CORS headers if necessary
    response = set_cors_headers_for_response(response)

    return response
示例#6
0
文件: flask_app.py 项目: mattbis/ckan
def ckan_after_request(response):
    u'''Common handler executed after all Flask requests'''

    # Dispose of the SQLALchemy session
    model.Session.remove()

    # Check session cookie
    response = check_session_cookie(response)

    # Set CORS headers if necessary
    response = set_cors_headers_for_response(response)

    return response
示例#7
0
def ckan_after_request(response):
    u'''Common handler executed after all Flask requests'''

    # Dispose of the SQLALchemy session
    model.Session.remove()

    # Check session cookie
    response = check_session_cookie(response)

    # Set CORS headers if necessary
    response = set_cors_headers_for_response(response)

    # Default to cache-control private if it was not set
    if response.cache_control.private is None:
        response.cache_control.private = True

    return response
示例#8
0
文件: flask_app.py 项目: wolney/ckan
def ckan_after_request(response):
    u'''Common handler executed after all Flask requests'''

    # Dispose of the SQLALchemy session
    model.Session.remove()

    # Check session cookie
    response = check_session_cookie(response)

    # Set CORS headers if necessary
    response = set_cors_headers_for_response(response)

    r_time = time.time() - g.__timer
    url = request.environ['PATH_INFO']

    log.info(' %s render time %.3f seconds' % (url, r_time))

    return response
示例#9
0
def ckan_after_request(response):
    u'''Common handler executed after all Flask requests'''

    # Dispose of the SQLALchemy session
    model.Session.remove()

    # Check session cookie
    response = check_session_cookie(response)

    # Set CORS headers if necessary
    response = set_cors_headers_for_response(response)

    # HDX - Don't allow caching for flask responses
    # Following PR might solve this more elegantly in the future: https://github.com/ckan/ckan/pull/4781
    response.cache_control.private = True


    return response
示例#10
0
def ckan_after_request(response):
    u'''Common handler executed after all Flask requests'''

    # Dispose of the SQLALchemy session
    model.Session.remove()

    # Check session cookie
    response = check_session_cookie(response)

    # Set CORS headers if necessary
    response = set_cors_headers_for_response(response)

    r_time = time.time() - g.__timer
    url = request.environ['CKAN_CURRENT_URL'].split('?')[0]

    log.info(' %s render time %.3f seconds' % (url, r_time))

    return response