-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When parsing a multi-part POST, retain original pairs (#2088)
The input is not guaranteed to be rewindable, and the default parameter expansion loses details of the parameter names. For form-encoded data, we (already) retain the full string: it contains only simple key/value pairs, and will be of a manageable size. Multipart data may contain uploaded files, so we don't wish to retain the full input string -- that's why we dropped the rewindability requirement on the input stream. Instead, we retain an array of two-element arrays representing the "raw" key-value pairs as we parsed the stream. This minimizes additional memory use, because the values are the same objects we use in the params hash, while still allowing an interested consumer to apply their own logic to parameter name interpretation.
- Loading branch information
Showing
4 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters