Releases: swift-standards/swift-rfc-7578
Releases · swift-standards/swift-rfc-7578
0.3.0
0.2.0
Breaking Changes
Removed Content-Transfer-Encoding from File struct
RFC 7578 Section 4.7 explicitly states that Content-Transfer-Encoding is deprecated for HTTP contexts because HTTP supports binary data natively:
"Senders SHOULD NOT generate any parts with a Content-Transfer-Encoding header field"
Changes
- ❌ BREAKING: Removed
transferEncodingproperty fromRFC_7578.FormData.File - ❌ BREAKING: Removed
transferEncodingparameter fromFile.init() - ✅ File content is now sent as raw binary data (no encoding)
- ✅ Type system now prevents invalid states
- ✅ Full RFC 7578 compliance for HTTP contexts
Migration Guide
Before (0.1.x):
let file = try RFC_7578.FormData.File(
fieldName: "avatar",
filename: "photo.jpg",
contentType: contentType,
transferEncoding: .base64, // ❌ Removed
content: imageData
)After (0.2.0):
let file = try RFC_7578.FormData.File(
fieldName: "avatar",
filename: "photo.jpg",
contentType: contentType,
content: imageData // ✅ Raw binary for HTTP
)Why This Change?
RFC 7578 is specifically for HTTP multipart/form-data, where binary data is natively supported. Content-Transfer-Encoding was needed for 7-bit email transports (RFC 2045), but is deprecated for HTTP use.
This change makes the type system enforce RFC compliance by making invalid states impossible.
0.1.1
0.1.0
Initial release of RFC 7578: Multipart/Form-Data
Features:
- Multipart/form-data subtype for HTTP file uploads
- FormData.File struct for binary file uploads
- Content-Disposition escaping for safe field names
- Support for text fields and file uploads
- Binary data with transfer encoding (base64)
- Swift 6.0 strict concurrency support
- Comprehensive test suite (7 tests)