From b63e8d0ca731284301bcbc25ed3c0ffa52a5b1e4 Mon Sep 17 00:00:00 2001 From: Charlie Scheer Date: Mon, 1 Jul 2024 13:41:20 -0600 Subject: [PATCH] Refactored account remote requesting passkey to convert data once --- Simplenote/AccountRemote.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Simplenote/AccountRemote.swift b/Simplenote/AccountRemote.swift index a1fbb965d..3d1077bbe 100644 --- a/Simplenote/AccountRemote.swift +++ b/Simplenote/AccountRemote.swift @@ -72,19 +72,19 @@ class AccountRemote: Remote { } private func body(with boundary: String, parameters: [String: Any]) -> Data { - var body = Data() + var body = String() for param in parameters { let paramName = param.key - body += Data("--\(boundary)\r\n".utf8) - body += Data("Content-Disposition:form-data; name=\"\(paramName)\"".utf8) + body += "--\(boundary)\r\n" + body += "Content-Disposition:form-data; name=\"\(paramName)\"" let paramValue = param.value as! String - body += Data("\r\n\r\n\(paramValue)\r\n".utf8) + body += "\r\n\r\n\(paramValue)\r\n" } - body += Data("--\(boundary)--\r\n".utf8) + body += "--\(boundary)--\r\n" - return body + return Data(body.utf8) } func requestChallengeResponseToCreatePasskey(forEmail email: String, password: String) async throws -> Data? {