Exemplo n.º 1
0
 def csrf_view(context, request):
     if request.method not in safe_methods and (
         callback is None or callback(request)
     ):
         check_csrf_origin(request, raises=True)
         check_csrf_token(request, token, header, raises=True)
     return view(context, request)
Exemplo n.º 2
0
 def csrf_view(context, request):
     if (
         request.method not in safe_methods and
         (callback is None or callback(request))
     ):
         check_csrf_origin(request, raises=True)
         check_csrf_token(request, token, header, raises=True)
     return view(context, request)
Exemplo n.º 3
0
    def _callFUT(self, *args, **kwargs):
        from pyramid.csrf import check_csrf_origin

        return check_csrf_origin(*args, **kwargs)
def receive_file(request):
    if request.authenticated_userid:
        check_csrf_origin(request) and check_csrf_token(request)
    upload = Upload.save_from(request, 'files[]')
    return {'upload_id': upload.id}
Exemplo n.º 5
0
    def _callFUT(self, *args, **kwargs):
        from pyramid.csrf import check_csrf_origin

        return check_csrf_origin(*args, **kwargs)
def receive_file(request):
    if request.authenticated_userid:
        check_csrf_origin(request) and check_csrf_token(request)
    upload = Upload.save_from(request, 'files[]')
    return {'upload_id': upload.id}