From ede637f53f25abedbe3a3dcaf18f9397c2a69efb Mon Sep 17 00:00:00 2001 From: alexchornyi <85160203+alexchornyi@users.noreply.github.com> Date: Tue, 20 Jul 2021 11:40:59 +0300 Subject: [PATCH] Fixed old certificate without hc1 (#87) * fixed fullPayloadString * fixed payload Co-authored-by: Alexandr Chernyy --- Sources/Models/HCert.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/Models/HCert.swift b/Sources/Models/HCert.swift index 945adcc..8b6142f 100644 --- a/Sources/Models/HCert.swift +++ b/Sources/Models/HCert.swift @@ -145,11 +145,13 @@ public struct HCert { public init?(from payload: String, errors: ParseErrors? = nil) { + let payload = payload if Self.checkCH1PreffixExist(payload) { fullPayloadString = payload payloadString = Self.parsePrefix(payload) } else { - fullPayloadString = Self.supportedPrefixes.first ?? "" + payload + fullPayloadString = Self.supportedPrefixes.first ?? "" + fullPayloadString = fullPayloadString + payload payloadString = payload }