Skip to content

Commit

Permalink
Add platform specific conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
cham-s committed Apr 23, 2024
1 parent 1c3de79 commit 3c8b213
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/WebSocketKit/WebSocket+Connect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ extension WebSocket {
on eventLoopGroup: EventLoopGroup,
onUpgrade: @Sendable @escaping (WebSocket) -> ()
) -> EventLoopFuture<Void> {
#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)
Expand Down

0 comments on commit 3c8b213

Please sign in to comment.