From c6cd4dce784c55fc532c826a8ad6e27827c24dd1 Mon Sep 17 00:00:00 2001 From: bwees Date: Tue, 24 Jun 2025 09:17:42 -0500 Subject: [PATCH] fix: include port in baseURL --- mobile/ios/WidgetExtension/ImmichAPI.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mobile/ios/WidgetExtension/ImmichAPI.swift b/mobile/ios/WidgetExtension/ImmichAPI.swift index 009698e5f8..43ed4ac1de 100644 --- a/mobile/ios/WidgetExtension/ImmichAPI.swift +++ b/mobile/ios/WidgetExtension/ImmichAPI.swift @@ -102,7 +102,13 @@ class ImmichAPI { } private static func validateServer(at endpointURL: URL) async -> URL? { - let baseURL = URL(string: endpointURL.scheme! + "://" + endpointURL.host!)! + // build a URL that is only scheme, host, and port + var components = URLComponents() + components.scheme = endpointURL.scheme + components.host = endpointURL.host + components.port = endpointURL.port + + guard let baseURL = components.url else { return nil } var pingURL = baseURL pingURL.appendPathComponent(".well-known")