-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Respect ini settings for file uploads #274
Conversation
@@ -67,18 +81,29 @@ private function __construct(ServerRequestInterface $request) | |||
if ($var !== false) { | |||
$this->maxInputNestingLevel = (int)$var; | |||
} | |||
|
|||
$this->uploadMaxFilesize = $uploadMaxFilesize === null ? $this->iniUploadMaxFilesize() : (int)$uploadMaxFilesize; |
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.
Does is make sense to also allow a string similar to the ini setting, like "8M"
? The conversion logic is already there.
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.
Good point! I'm not opposed, but would rather look into this in a follow-up PR because this also affects the RequestBodyBufferMiddleware
👍
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.
Opened #275 for that 👍
|
||
/** | ||
* @param int|null $uploadMaxFilesize | ||
*/ |
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.
@param int|null $maxFileUploads
missing?
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.
Good catch, updated
This PR ensures that the
RequestBodyParserMiddleware
respects all relevant ini settings for file uploads. In other words, this middleware will now respect the following ini settings:Additionally, two parameters have been added to explicitly configure these settings like this:
I realize that this PR is not exactly trivial. If you want to review this, I would suggest checking out the individual commits.
Builds on top of #268
Resolves / closes #257