swiftlang / swift-foundation

The Foundation project
Apache License 2.0
2.36k stars 150 forks source link

URLComponents: support ws(s)+unix schemes #918

Closed jrflat closed 3 days ago

jrflat commented 3 days ago

Similar to https://github.com/apple/swift-foundation/pull/883, the common way to represent a "WebSocket over Unix socket" URL is to use the scheme ws+unix and set the URL's host to the percent-encoded path of the socket.

This PR adds ws+unix and wss+unix to the set of schemes where we percent-encode the host instead of IDNA-encode.

jrflat commented 3 days ago

@swift-ci please test