Beispiel #1
0
    def start_request(self, request):
        SessionPublisher.start_request(self, request)
        os.environ['SQLSTORE_SOURCE'] = request.get_url()

        resp = request.response
        resp.set_content_type('text/html; charset=utf-8')
        resp.set_header('Pragma', 'no-cache')
        resp.set_header('Cache-Control', 'must-revalidate, no-cache, private')
        # FIXME: quixote with origin?
        resp.set_header('Access-Control-Allow-Origin', '*')
        request.enable_ajax = False
        request.browser = request.guess_browser_version()
        request.method = request.get_method()
        request.url = request.get_path()
        request.is_mobile = is_mobile_device(request)
        request.start_time = time.time()
        request.user = None
        check_auth(request)  # OAuth
        if request.user is None:
            request.user = User.get_current_user()

        import_obj_set("request", request)
Beispiel #2
0
    def start_request(self, request):
        SessionPublisher.start_request(self, request)
        os.environ['SQLSTORE_SOURCE'] = request.get_url()

        resp = request.response
        resp.set_content_type('text/html; charset=utf-8')
        resp.set_header('Pragma', 'no-cache')
        resp.set_header('Cache-Control', 'must-revalidate, no-cache, private')
        # FIXME: quixote with origin?
        resp.set_header('Access-Control-Allow-Origin', '*')
        request.enable_ajax = False
        request.browser = request.guess_browser_version()
        request.method = request.get_method()
        request.url = request.get_path()
        request.is_mobile = is_mobile_device(request)
        request.start_time = time.time()
        request.user = None
        check_auth(request)  # OAuth
        if request.user is None:
            request.user = User.get_current_user()

        import_obj_set("request", request)
Beispiel #3
0
def _q_access(request):
    check_auth(request)
    if 'svn2git' not in request.get_url():
        request.response.set_content_type('application/json; charset=utf8')
Beispiel #4
0
def _q_access(request):
    check_auth(request)
    if 'svn2git' not in request.get_url():
        request.response.set_content_type('application/json; charset=utf8')
Beispiel #5
0
def _q_access(request):
    check_auth(request)
    if not request.user:
        raise TraversalError()
Beispiel #6
0
def _q_access(request):
    check_auth(request)
    if not request.user:
        raise TraversalError()