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
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
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
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
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
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
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