I have the following in my Django webapp:
class IndexContentView(generics.CreateAPIView):
permission_classes = [IsAuthenticated]
def create(self, request):
transcript = request.data['transcript']
How can I make sure that requests with request.data
larger than a certain size, such as 2 MB, do not hit my endpoint? I know I could insert a check in my code, but that would not prevent an attack throwing many large requests at my app. Also, I want to set a limit for all requests. How do I do this with PA?