Skip to content

Commit fe9abe3

Browse files
Merge pull request #22 from FelixHerrmann/fix/data-concatenation-error-in-swift-6-3
[Fix] Data Concatenation Error in Swift 6.3
2 parents 4c3d002 + 0b94909 commit fe9abe3

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

Sources/MultipartFormData/MultipartFormData.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ extension MultipartFormData {
116116
/// This combines all the data from the subparts into one big data object.
117117
public var httpBody: Data {
118118
let bodyData: Data = body
119-
.map { ._dash + boundary._asciiData + ._crlf + $0.data + ._crlf }
119+
.map { Data._dash + boundary._asciiData + Data._crlf + $0.data + Data._crlf }
120120
.reduce(Data(), +)
121-
return bodyData + ._dash + boundary._asciiData + ._dash + ._crlf
121+
return bodyData + Data._dash + boundary._asciiData + Data._dash + Data._crlf
122122
}
123123
}
124124

@@ -162,7 +162,7 @@ extension MultipartFormData {
162162

163163
extension MultipartFormData: CustomDebugStringConvertible {
164164
public var debugDescription: String {
165-
let bytes: Data = contentType.data + ._crlf + ._crlf + httpBody
165+
let bytes: Data = contentType.data + Data._crlf + Data._crlf + httpBody
166166
return String(bytes: bytes, encoding: .utf8) ?? ""
167167
}
168168
}

Sources/MultipartFormData/Subpart.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ extension Subpart: CustomDebugStringConvertible {
8989
extension Subpart {
9090
/// The data representation of a subpart.
9191
public var data: Data {
92-
let contentTypeData: Data = contentType.map { $0.data + ._crlf } ?? Data()
93-
return contentDisposition.data + ._crlf + contentTypeData + ._crlf + body
92+
let contentTypeData: Data = contentType.map { $0.data + Data._crlf } ?? Data()
93+
return contentDisposition.data + Data._crlf + contentTypeData + Data._crlf + body
9494
}
9595
}

0 commit comments

Comments
 (0)