-
Notifications
You must be signed in to change notification settings - Fork 397
Fix Max Upload Size handling #893
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
Conversation
|
|
||
| /// <summary> | ||
| /// The maximum allowed size in megabytes for a request body posted to the upload endpoint. | ||
| /// The maximum allowed size in bytes for a request body posted to the upload endpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as per conversation, I'd prefer sticking to "megabytes"
| { | ||
| if (this.MaxUploadSizeMb.HasValue) | ||
| { | ||
| return Math.Min(10, this.MaxUploadSizeMb.Value) * 1024 * 1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the only line that needs fixing, using Math.Max. I'd keep also the min of 10Mb in place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So don't you want to handle scenarios where, for example, I need to limit the upload to 1 MB?
dluc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments
|
I think that this PR has been superseded by #896, so it can be closed. |
Motivation and Context (Why the change? What's the scenario?)
See #863 (comment) and the comments below