Skip to content

Releases: swift-standards/swift-rfc-7578

0.3.0

27 Nov 23:02

Choose a tag to compare

Update to RFC_2046 0.2.1 API

0.2.0

12 Nov 15:40

Choose a tag to compare

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 transferEncoding property from RFC_7578.FormData.File
  • BREAKING: Removed transferEncoding parameter from File.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

12 Nov 15:03

Choose a tag to compare

Patch release: Use semantic versioning for dependencies

0.1.0

12 Nov 15:00

Choose a tag to compare

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)