Fix exceptions thrown on already migrated JSON
Also remove deprecated tunnel configuration keys.
This commit is contained in:
parent
4344eb9779
commit
8f29f79168
|
@ -58,7 +58,8 @@ extension ConnectionService {
|
||||||
|
|
||||||
static func migrateToWrappedSessionConfiguration(_ json: inout [String: Any]) throws {
|
static func migrateToWrappedSessionConfiguration(_ json: inout [String: Any]) throws {
|
||||||
guard let profiles = json["profiles"] as? [[String: Any]] else {
|
guard let profiles = json["profiles"] as? [[String: Any]] else {
|
||||||
throw ApplicationError.migration
|
// migrated
|
||||||
|
return
|
||||||
}
|
}
|
||||||
var newProfiles: [[String: Any]] = []
|
var newProfiles: [[String: Any]] = []
|
||||||
for var container in profiles {
|
for var container in profiles {
|
||||||
|
@ -83,6 +84,7 @@ extension ConnectionService {
|
||||||
|
|
||||||
static func migrateToBaseConfiguration(_ json: inout [String: Any]) throws {
|
static func migrateToBaseConfiguration(_ json: inout [String: Any]) throws {
|
||||||
guard var baseConfiguration = json["tunnelConfiguration"] as? [String: Any] else {
|
guard var baseConfiguration = json["tunnelConfiguration"] as? [String: Any] else {
|
||||||
|
// migrated
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
migrateSessionConfiguration(in: &baseConfiguration)
|
migrateSessionConfiguration(in: &baseConfiguration)
|
||||||
|
@ -124,5 +126,8 @@ extension ConnectionService {
|
||||||
sessionConfiguration["renegotiatesAfter"] = value
|
sessionConfiguration["renegotiatesAfter"] = value
|
||||||
}
|
}
|
||||||
map["sessionConfiguration"] = sessionConfiguration
|
map["sessionConfiguration"] = sessionConfiguration
|
||||||
|
|
||||||
|
map.removeValue(forKey: "debugLogKey")
|
||||||
|
map.removeValue(forKey: "lastErrorKey")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue