Closed
Description
Initializing a URL from an IPv6 address in Swift 6 on Linux now does not strip enclosing square-brackets. In earlier Swift versions and on macOS the square-brackets are removed.
As well as being a behavior change this can cause issues when passing the host component on e.g. to inet_pton
which doesn't tolerate the square braces.
On Linux Swift 5.10:
1> import Foundation
2> let u = Foundation.URL(string: "http://[::1]")
[snip]
3> print(u!.host)
Optional("::1")
On Linux Swift 6.0.1:
1> import Foundation
2> let u = Foundation.URL(string: "http://[::1]")
[snip]
3> print(u!.host)
Optional("[::1]")
Metadata
Metadata
Assignees
Labels
No labels