From 09ba4eb8c8620ee81ae5b28ea2bf42e01ebf5268 Mon Sep 17 00:00:00 2001 From: Federico Date: Wed, 7 Dec 2016 12:30:36 -0500 Subject: [PATCH 1/2] (irrelevant) updates to swift 3 conversion --- Haitch.xcodeproj/project.pbxproj | 4 ++-- Source/Helpers/NetHelper.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Haitch.xcodeproj/project.pbxproj b/Haitch.xcodeproj/project.pbxproj index d9354f6..bbe5453 100644 --- a/Haitch.xcodeproj/project.pbxproj +++ b/Haitch.xcodeproj/project.pbxproj @@ -324,14 +324,14 @@ TargetAttributes = { A3034B7F1BFD61F4003F8705 = { CreatedOnToolsVersion = 7.1.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0810; }; A3034B8F1BFD6229003F8705 = { CreatedOnToolsVersion = 7.1.1; }; CA8887F71D400317005A8390 = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0810; }; }; }; diff --git a/Source/Helpers/NetHelper.swift b/Source/Helpers/NetHelper.swift index 26d2803..5518db6 100644 --- a/Source/Helpers/NetHelper.swift +++ b/Source/Helpers/NetHelper.swift @@ -56,10 +56,10 @@ open class NetHelper { let parts: [HttpKeyPair] = params.allParams() for keyPair: HttpKeyPair in parts { let isMultiVal = params.isKeyMultiValue(key: keyPair.key) - let prefix = keyPair.escapedKeyPrefix ?? "" + let prefix = keyPair.escapedKeyPrefix var suffix = "" if isMultiVal { - suffix = keyPair.escapedKeySuffix ?? "" + suffix = keyPair.escapedKeySuffix } queryStringVal += "\(keyPair.toPartString(keyPrefix: prefix, keySuffix: suffix))&" } From 9980fe4822747d9d329896bce141450db1c5db40 Mon Sep 17 00:00:00 2001 From: Federico Date: Wed, 7 Dec 2016 12:32:24 -0500 Subject: [PATCH 2/2] MultipartRequestBody: turned property `boundary` into non-optional type String --- Source/Core/MultipartRequestBody.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/MultipartRequestBody.swift b/Source/Core/MultipartRequestBody.swift index 8c6298a..fc2fab3 100644 --- a/Source/Core/MultipartRequestBody.swift +++ b/Source/Core/MultipartRequestBody.swift @@ -179,7 +179,7 @@ open class MultipartRequestBody : RequestBody { /// The boundary value of the MultipartRequestBody. Defaulted in the initializer to /// "Boundary+\(arc4random())\(arc4random())" - open var boundary: String! + open var boundary: String = "" /// The boundary carriage returns and line feed value. Defaults to "\r\n" open var boundaryCRLF = "\r\n" @@ -192,6 +192,7 @@ open class MultipartRequestBody : RequestBody { public override init() { super.init() self.boundary = "Boundary+\(arc4random())\(arc4random())" + self.contentType = "multipart/form-data; boundary=\(self.boundary)" } /**