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 test_ignore_one(self, request: web.Request) -> tomodachi.HttpResponse:
test = await request.text()
if test == '200':
return tomodachi.HttpResponse(body='test-200', status=200)
else:
return tomodachi.HttpResponse(body='test-201', status=201)
async def test_ignore_one(self, request: web.Request) -> tomodachi.HttpResponse:
test = await request.text()
if test == '200':
return tomodachi.HttpResponse(body='test-200', status=200)
else:
return tomodachi.HttpResponse(body='test-201', status=201)
async def response_object(self, request: web.Request) -> HttpResponse:
return HttpResponse(body='{"data": true}', status=200, content_type='application/json')
async def response_object(self, request: web.Request) -> HttpResponse:
return HttpResponse(body='{"data": true}', status=200, content_type='application/json')
async def require_auth_token(instance: Any, request: web.Request) -> Any:
post_body = await request.read() if request.body_exists else None
if not post_body or post_body.decode() != instance.allowed_token:
return HttpResponse(body='Invalid token', status=403)