Skip to content

Commit

Permalink
Fix file upload for base64 encoded files
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeSneyders committed Dec 29, 2023
1 parent 0ae9ba8 commit 1cb78ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions connexion/validators/form_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ async def _parse(self, stream: t.AsyncGenerator[bytes, None], scope: Scope) -> d
value = data.getlist(key)

def is_file(schema):
return (
schema.get("type") == "string"
and schema.get("format") == "binary"
)
return schema.get("type") == "string" and schema.get("format") in [
"binary",
"base64",
]

# Single file upload
if is_file(param_schema):
Expand Down

0 comments on commit 1cb78ff

Please sign in to comment.