swiftlang / swift-foundation

The Foundation project
Apache License 2.0
2.4k stars 160 forks source link

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

Closed jrflat closed 1 month ago

jrflat commented 1 month 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 1 month ago

@swift-ci please test