swiftlang / swift-foundation

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

Add linked-on-or-after check for apps that pass an empty URL string #1042

Closed jrflat closed 2 days ago

jrflat commented 2 days ago

This PR adds a linked-on-or-after check for apps which pass an empty string to URL(string:), which previously returned nil. The new URL(string:) implementations allow the empty string as input since an empty path is valid and can be resolved against a base URL. This is shown in the RFC 3986 examples: https://datatracker.ietf.org/doc/html/rfc3986#section-5.4.1

jrflat commented 2 days ago

@swift-ci please test