From a98943728fc1543e8f74a3622698977ad742d1a0 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Sat, 17 Jul 2021 09:26:30 +0200 Subject: [PATCH] Relax handling of .ovpn whitespaces --- CHANGELOG.md | 1 + TunnelKit/Sources/Protocols/OpenVPN/ConfigurationParser.swift | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c95668..d7d84e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Return error in install completion handler. [#206](https://github.com/passepartoutvpn/tunnelkit/issues/206) +- Relax handling of whitespaces in configuration file. ## 3.3.2 (2021-06-26) diff --git a/TunnelKit/Sources/Protocols/OpenVPN/ConfigurationParser.swift b/TunnelKit/Sources/Protocols/OpenVPN/ConfigurationParser.swift index 8c1895e..5b5a748 100644 --- a/TunnelKit/Sources/Protocols/OpenVPN/ConfigurationParser.swift +++ b/TunnelKit/Sources/Protocols/OpenVPN/ConfigurationParser.swift @@ -863,6 +863,7 @@ private extension String { func trimmedLines() -> [String] { return components(separatedBy: .newlines).map { $0.trimmingCharacters(in: .whitespacesAndNewlines) + .replacingOccurrences(of: "\\s", with: " ", options: .regularExpression) }.filter { !$0.isEmpty }