From f6d65ab8af3b200bec905d6f0504535f0f717dd4 Mon Sep 17 00:00:00 2001 From: James Diacono Date: Wed, 8 Apr 2020 12:25:34 +1000 Subject: [PATCH] fix(ios): allow access to extension-less files (#2725) --- ios/Capacitor/Capacitor/CAPAssetHandler.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/Capacitor/Capacitor/CAPAssetHandler.swift b/ios/Capacitor/Capacitor/CAPAssetHandler.swift index ceb02181ae..0493d35995 100644 --- a/ios/Capacitor/Capacitor/CAPAssetHandler.swift +++ b/ios/Capacitor/Capacitor/CAPAssetHandler.swift @@ -14,10 +14,10 @@ class CAPAssetHandler: NSObject, WKURLSchemeHandler { let url = urlSchemeTask.request.url! let stringToLoad = url.path - if stringToLoad.isEmpty || url.pathExtension.isEmpty { - startPath.append("/index.html") - } else if stringToLoad.starts(with: CAPBridge.CAP_FILE_START) { + if stringToLoad.starts(with: CAPBridge.CAP_FILE_START) { startPath = stringToLoad.replacingOccurrences(of: CAPBridge.CAP_FILE_START, with: "") + } else if stringToLoad.isEmpty || url.pathExtension.isEmpty { + startPath.append("/index.html") } else { startPath.append(stringToLoad) }