Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add max_part_size parameter to MultiPartParser #2815

Merged
merged 11 commits into from
Dec 28, 2024

Conversation

iudeen
Copy link
Contributor

@iudeen iudeen commented Dec 26, 2024

Fixes #2785

Also addresses issue discussed in FastAPI Repo.

Comment on lines 132 to 133
max_file_size: int = 1024 * 1024, # 1MB
max_part_size: int | float = 1024 * 1024, # 1MB
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove defaults here and keep the default at top most function?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is okay.

@iudeen iudeen requested a review from tiangolo December 26, 2024 12:32
starlette/formparsers.py Show resolved Hide resolved
Comment on lines 132 to 133
max_file_size: int = 1024 * 1024, # 1MB
max_part_size: int | float = 1024 * 1024, # 1MB
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is okay.

@iudeen iudeen requested a review from Kludex December 26, 2024 12:57
starlette/requests.py Outdated Show resolved Hide resolved
tests/test_formparsers.py Outdated Show resolved Hide resolved
Copy link
Member

@Kludex Kludex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thanks. :)

@Kludex Kludex changed the title Make max_part_size customizable Add max_part_size parameter to MultiPartParser Dec 28, 2024
@Kludex Kludex enabled auto-merge (squash) December 28, 2024 04:55
@Kludex Kludex merged commit cef7834 into encode:master Dec 28, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MultiPartException: Part exceeded maximum size 1M
2 participants