Skip to content

Commit ca3c456

Browse files
committed
Adding missed new-line and enclosing missed line with Data()
1 parent c7ce77c commit ca3c456

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

codegens/swift/lib/swift.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ function parseFormData (body, mode, trim, indent) {
128128
bodySnippet += `${indent}} else {\n`;
129129
bodySnippet += `${indent.repeat(2)}let paramSrc = param["src"] as! String\n`;
130130
bodySnippet += `${indent.repeat(2)}let fileURL = URL(fileURLWithPath: paramSrc)\n`;
131-
bodySnippet += `${indent.repeat(2)}if let fileContent = try? Data(contentsOf: fileURL) {`;
132-
bodySnippet += `${indent.repeat(3)}body += ("; filename=\\"\\(paramSrc)\\"\\r\\n".utf8)\n`;
131+
bodySnippet += `${indent.repeat(2)}if let fileContent = try? Data(contentsOf: fileURL) {\n`;
132+
bodySnippet += `${indent.repeat(3)}body += Data("; filename=\\"\\(paramSrc)\\"\\r\\n".utf8)\n`;
133133
bodySnippet += `${indent.repeat(3)}body += Data("Content-Type: \\"content-type header\\"\\r\\n".utf8)\n`;
134134
bodySnippet += `${indent.repeat(3)}body += Data("\\r\\n".utf8)\n`;
135135
bodySnippet += `${indent.repeat(3)}body += fileContent\n`;

0 commit comments

Comments
 (0)