Merge pull request #20 from keeshux/incorrect-compression-warnings

Incorrect compression warnings
This commit is contained in:
Davide De Rosa 2018-11-02 00:12:51 +01:00 committed by GitHub
commit c7377a548b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 6 deletions

View File

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Fixed
- Incorrect compression warnings when importing host configurations. [#20](https://github.com/keeshux/passepartout-ios/pull/20)
## 1.0 RC1 1194 (2018-11-01) ## 1.0 RC1 1194 (2018-11-01)
### Added ### Added

View File

@ -29,7 +29,7 @@ import SwiftyBeaver
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self
extension ConnectionService { extension ConnectionService {
static func migrateJSON(at from: URL, to: URL) { static func migrateJSON(from: URL, to: URL) {
do { do {
let newData = try migrateJSON(at: from) let newData = try migrateJSON(at: from)
// log.verbose(String(data: newData, encoding: .utf8)!) // log.verbose(String(data: newData, encoding: .utf8)!)
@ -39,8 +39,8 @@ extension ConnectionService {
} }
} }
private static func migrateJSON(at from: URL) throws -> Data { static func migrateJSON(at url: URL) throws -> Data {
let data = try Data(contentsOf: from) let data = try Data(contentsOf: url)
guard var json = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] else { guard var json = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] else {
throw ApplicationError.migration throw ApplicationError.migration
} }

View File

@ -53,7 +53,7 @@ class TransientStore {
private init() { private init() {
let cfg = AppConstants.VPN.baseConfiguration() let cfg = AppConstants.VPN.baseConfiguration()
do { do {
ConnectionService.migrateJSON(at: TransientStore.serviceURL, to: TransientStore.serviceURL) ConnectionService.migrateJSON(from: TransientStore.serviceURL, to: TransientStore.serviceURL)
let data = try Data(contentsOf: TransientStore.serviceURL) let data = try Data(contentsOf: TransientStore.serviceURL)
if let content = String(data: data, encoding: .utf8) { if let content = String(data: data, encoding: .utf8) {

View File

@ -53,9 +53,9 @@ extension TunnelKitProvider.Configuration {
static let auth = Utils.regex("^auth +[\\w\\-]+") static let auth = Utils.regex("^auth +[\\w\\-]+")
static let compLZO = Utils.regex("^comp-lzo") static let compLZO = Utils.regex("^comp-lzo.*")
static let compress = Utils.regex("^compress") static let compress = Utils.regex("^compress.*")
static let ping = Utils.regex("^ping +\\d+") static let ping = Utils.regex("^ping +\\d+")