From 7f61dd606c5a0436e7eee1191b6f86e78c487bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20R=C3=A4dle?= Date: Tue, 8 Oct 2024 13:47:54 -0700 Subject: [PATCH] [sam2][demo][1/x] Fix file upload Summary: The Strawberry GraphQL library recently disabled multipart requests by default. This resulted in a video upload request returning "Unsupported content type" instead of uploading the video, processing it, and returning the video path. This change enables multipart request support on the endpoint view. Test Plan: Tested locally and upload succeeds --- demo/backend/server/app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/demo/backend/server/app.py b/demo/backend/server/app.py index 9902f475f..424e85bb5 100644 --- a/demo/backend/server/app.py +++ b/demo/backend/server/app.py @@ -128,6 +128,10 @@ def get_context(self, request: Request, response: Response) -> Any: # https://strawberry.rocks/docs/operations/deployment # https://strawberry.rocks/docs/integrations/flask allow_queries_via_get=False, + # Strawberry recently changed multipart request handling, which now + # requires enabling support explicitly for views. + # https://github.com/strawberry-graphql/strawberry/issues/3655 + multipart_uploads_enabled=True, ), )