def add_session_to_request(request):
# before each request initialize a session
# using the client's request
host = request.headers.get('host', None)
user_agent = request.headers.get('user-agent', None)
if user_agent:
if CONFIG.VAL_HOST == 'true':
if not host or host not in CONFIG.HOST:
return redirect('http://www.owllook.net')
if CONFIG.WEBSITE['IS_RUNNING']:
await app.session_interface.open(request)
else:
return html("<h3>??????...</h3>")
else:
return html("<h3>??????...</h3>")
评论列表
文章目录