Skip to content

Commit

Permalink
Fixed old certificate without hc1 (#87)
Browse files Browse the repository at this point in the history
* fixed fullPayloadString

* fixed payload

Co-authored-by: Alexandr Chernyy <[email protected]>
  • Loading branch information
alexchornyi and pingus-nikalex authored Jul 20, 2021
1 parent 4638582 commit ede637f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/Models/HCert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit ede637f

Please sign in to comment.