Releases: vapor/multipart-kit
Add platform specifiers
This patch was authored and released by @gwynne.
Match Vapor's support
Depend on Swift Collections
This patch was authored by @ahmdyasser and released by @0xTim.
Removes the vended copy of Swift Collections and adds it as a dependency.
Resolves #82
Remove platform requirements
Add `FormDataDecoder.decode` with `ByteBuffer` parameter
This patch was authored by @adam-fowler and released by @0xTim.
Add FormDataDecoder.decode
with ByteBuffer
parameter and use this function in the other decode
functions. This avoids unnecessary conversions from ByteBuffer to [UInt8] and back.
Add FormDataDecoder.decode
with ByteBuffer
parameter
Resolves #75
Support Indexed Arrays
This patch was authored and released by @siemensikkema.
Supports indexed array elements when decoding and encoding form data (fixes #67, replaces #69).
Indicating that a value belongs to an array can now be done by appending [0]
, [1]
, etc. to the name, as an alternative to the already supported []
. This allows for representing nested data inside elements in an array.
For instance, let matrix: [[Int]] = [[42,21]]
can now be represented using part names matrix[0][0]
and matrix[0][1]
. Without indexed array elements there is no way to distinguish the above from [[42],[21]]
.
Note:
FormDataEncoder
now also includes indexes for array types in its output.
Credits go to @chocoford for identifying the issue, the test cases and the initial PR!
Redesign FormDataEncoder and FormDataDecoder
This patch was authored and released by @siemensikkema.
Redesign FormDataEncoder and FormDataDecoder to better align with Codable's intended behavior.
- Support decoding top level optionals (fixes #68)
- Adds a
userInfo
property toFormDataDecoder
andFormDataEncoder
- More correct handling of "superDecoder" and "superEncoder"
- When nesting depth is exceeded we first fail when we’re actually trying to grab data from beyond the nesting limit
- Add some missing API docs
Fix regression that broke falling back to Codable
This patch was authored and released by @siemensikkema.
Fixes regression that broke falling back to Codable
for types not conforming to MultipartPartConvertible
(#66, fixes #65)
Note: this removes conformance of UUID
to MultipartPartConvertible
introduced in 4.2.0 because it is no longer needed.
Add support for encoding/decoding UUIDs
This patch was authored and released by @siemensikkema.
Add support for encoding and decoding UUID
s (#64)
Support nested multipart encoding
This patch was authored and released by @siemensikkema.
Add encoding and decoding support for nested objects (#57)
In order to avoid overflows by malicious actors there is a maximum nesting depth associated with FormDataDecoder
. It defaults to 8
but is configurable in the initializer like so: FormDataEncoder(nestingDepth: 8)
.
This update also deprecates MultipartError
.
Fix: MultipartParser cannot decode Non-ASCII header correctly
This patch was authored by @t-ae and released by @siemensikkema.
Fix the bug that MultipartParser
cannot decode headers that contains non-ASCII characters correctly.