diff --git a/Sources/WebSocketKit/WebSocket+Connect.swift b/Sources/WebSocketKit/WebSocket+Connect.swift index 4259659..83a03dc 100644 --- a/Sources/WebSocketKit/WebSocket+Connect.swift +++ b/Sources/WebSocketKit/WebSocket+Connect.swift @@ -20,9 +20,9 @@ extension WebSocket { on eventLoopGroup: EventLoopGroup, onUpgrade: @Sendable @escaping (WebSocket) -> () ) -> EventLoopFuture { - #if canImport(Foundation) + #if os(iOS) || os(tvOS) || os(watchOS) || os(macOS) let optionalURL: URL? - if #available(iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0, *) { + if #available(iOS 17.0, macOS 14.4, tvOS 17.0, watchOS 10.0, *) { optionalURL = URL(string: url, encodingInvalidCharacters: false) } else { optionalURL = URL(string: url)