We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from japronto import Application
def donotwork(request): access = 1 if isAllow(access,request): return request.Response(text='Hello world!')
def work(request): access = 1
if access == 0: return request.Response(headers={'Location': '/notauth'}, code=302) if access == 1: return request.Response(headers={'Location': '/denied'}, code=302) if access == 2: return request.Response(text='Hello world!')
def denied(request): return request.Response(text='denied!')
def allowed(request): return request.Response(text='allowed!')
def notauth(request): return request.Response(text='not auth!')
def isAllow(access,request):
if access == 0: return request.Response(headers={'Location': '/notauth'}, code=302) if access == 1: return request.Response(headers={'Location': '/denied'}, code=302) if access == 2: return True
app = Application() app.router.add_route('/donotwork', donotwork) app.router.add_route('/work', work) app.router.add_route('/allowed', allowed) app.router.add_route('/denied', denied) app.router.add_route('/notauth', notauth) app.router.add_route('/work', work) app.run(debug=True)
I try to solve problem of ACL if I invoke "donotwork" handler I get error RuntimeError: Request.Response can only be called once per request .**
I try to solve problem of ACL
if I invoke "donotwork" handler I get error
RuntimeError: Request.Response can only be called once per request .**
The text was updated successfully, but these errors were encountered:
No branches or pull requests
from japronto import Application
def donotwork(request):
access = 1
if isAllow(access,request):
return request.Response(text='Hello world!')
def work(request):
access = 1
def denied(request):
return request.Response(text='denied!')
def allowed(request):
return request.Response(text='allowed!')
def notauth(request):
return request.Response(text='not auth!')
def isAllow(access,request):
app = Application()
app.router.add_route('/donotwork', donotwork)
app.router.add_route('/work', work)
app.router.add_route('/allowed', allowed)
app.router.add_route('/denied', denied)
app.router.add_route('/notauth', notauth)
app.router.add_route('/work', work)
app.run(debug=True)
The text was updated successfully, but these errors were encountered: