swiftlang / swift-corelibs-foundation

The Foundation Project, providing core utilities, internationalization, and OS independence
swift.org
Apache License 2.0
5.29k stars 1.13k forks source link

Fix crash when using WebSockets with URLSession.shared #5128

Closed jrflat closed 3 weeks ago

jrflat commented 3 weeks ago

The previous code expected all URLSessionWebSocketTask to have a delegate, so using a WebSocket task from URLSession.shared caused a fatalError. This PR updates that expectation so that having a delegate is not enforced.

Resolves #4730

jrflat commented 3 weeks ago

@swift-ci please test