Various fixes

This commit is contained in:
Ilya Laktyushin
2023-02-18 17:35:13 +04:00
parent fa1b3d5b97
commit 102864c9a0
6 changed files with 38 additions and 23 deletions

View File

@@ -959,8 +959,8 @@ public func resolveUrlImpl(context: AccountContext, peerId: PeerId?, url: String
for scheme in schemes {
let basePrefix = scheme + basePath + "/"
var url = url
if (url.lowercased().hasPrefix(scheme) && url.lowercased().hasSuffix(".\(basePath)")) {
url = basePrefix + String(url[scheme.endIndex...]).replacingOccurrences(of: ".\(basePath)", with: "")
if (url.lowercased().hasPrefix(scheme) && (url.lowercased().hasSuffix(".\(basePath)") || url.lowercased().contains(".\(basePath)/"))) {
url = basePrefix + String(url[scheme.endIndex...]).replacingOccurrences(of: ".\(basePath)/", with: "").replacingOccurrences(of: ".\(basePath)", with: "")
}
if url.lowercased().hasPrefix(basePrefix) {
if let internalUrl = parseInternalUrl(query: String(url[basePrefix.endIndex...])) {