mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 06:58:28 +02:00
MESSENGER-4549 strict check for mapstyle url
This commit is contained in:
@@ -73,15 +73,16 @@ final class HomeserverConfigurationBuilder: NSObject {
|
||||
|
||||
// Tile server configuration
|
||||
|
||||
let tileServerMapStyleURL: URL
|
||||
|
||||
|
||||
var tileServerMapStyleURL: URL = URL(string: BWIBuildSettings.shared.serverConfigDefaultMapstyleURLString)!
|
||||
if let mapStyleURLString = wellKnown?.tileServer?.mapStyleURLString,
|
||||
let mapStyleURL = URL(string: mapStyleURLString) {
|
||||
tileServerMapStyleURL = mapStyleURL
|
||||
} else {
|
||||
tileServerMapStyleURL = URL(string: BWIBuildSettings.shared.serverConfigDefaultMapstyleURLString)!
|
||||
if verifyUrl(url: mapStyleURL) {
|
||||
tileServerMapStyleURL = mapStyleURL
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let tileServerConfiguration = HomeserverTileServerConfiguration(mapStyleURL: tileServerMapStyleURL)
|
||||
|
||||
// Create HomeserverConfiguration
|
||||
@@ -145,4 +146,8 @@ final class HomeserverConfigurationBuilder: NSObject {
|
||||
|
||||
return jitsiServerURL
|
||||
}
|
||||
|
||||
private func verifyUrl (url: URL) -> Bool {
|
||||
return UIApplication.shared.canOpenURL(url)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user