Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def handler(request):
return text("OK")
async def post(request, id):
assert isinstance(request.stream, StreamBuffer)
result = ""
while True:
body = await request.stream.read()
if body is None:
break
result += body.decode("utf-8")
return text(result)
async def handler(request):
return text("OK")
async def foo_root_handler(request):
return text("OK") # noqa
def handler(request):
response = text("pass")
response.cookies["test"] = "pass"
response.cookies["test"]["expires"] = expires
return response
@app.get("/")
async def hello(request: Request):
"""Check if the server is running and responds with the version."""
return response.text("Hello from Rasa: " + rasa.__version__)
async def index(request):
return text("hello world")
def handler_text(request):
return response.text("Hello")
def index2(request, args, context):
shared = context.shared
_ = shared.request
return text("hello world")
if output:
if "visitor" not in output:
sender_name = output.get("user_name", None)
text = output.get("text", None)
recipient_id = output.get("channel_id", None)
else:
messages_list = output.get("messages", None)
text = messages_list[0].get("msg", None)
sender_name = messages_list[0].get("username", None)
recipient_id = output.get("_id")
await self.send_message(
text, sender_name, recipient_id, on_new_message, metadata
)
return response.text("")