Skip to content

Commit

Permalink
Revert "refactor: fix type for other paramters in MultiPart"
Browse files Browse the repository at this point in the history
This reverts commit 143d9d4.
  • Loading branch information
iudeen committed Dec 26, 2024
1 parent 143d9d4 commit 7b869bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions starlette/formparsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ async def parse(self) -> FormData:


class MultiPartParser:
max_file_size: int = 1024 * 1024 # 1MB
max_file_size = 1024 * 1024 # 1MB

def __init__(
self,
headers: Headers,
stream: typing.AsyncGenerator[bytes, None],
*,
max_files: int = 1000,
max_fields: int = 1000,
max_files: int | float = 1000,
max_fields: int | float = 1000,
max_part_size: int = 1024 * 1024, # 1MB
) -> None:
assert multipart is not None, "The `python-multipart` library must be installed to use form parsing."
Expand Down
8 changes: 4 additions & 4 deletions starlette/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ async def json(self) -> typing.Any:
async def _get_form(
self,
*,
max_files: int = 1000,
max_fields: int = 1000,
max_files: int | float = 1000,
max_fields: int | float = 1000,
max_part_size: int = 1024 * 1024,
) -> FormData:
if self._form is None:
Expand Down Expand Up @@ -287,8 +287,8 @@ async def _get_form(
def form(
self,
*,
max_files: int = 1000,
max_fields: int = 1000,
max_files: int | float = 1000,
max_fields: int | float = 1000,
max_part_size: int = 1024 * 1024,
) -> AwaitableOrContextManager[FormData]:
return AwaitableOrContextManagerWrapper(
Expand Down

0 comments on commit 7b869bb

Please sign in to comment.