Skip to content

Restore behavior of URL(string: "") returning nil #1103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

jrflat
Copy link
Contributor

@jrflat jrflat commented Dec 20, 2024

After receiving more reports of bincompat issues, we're restoring the previous behavior of URL(string: "") returning nil. URL(string: "", relativeTo: baseURL) will still be valid input, allowing us to pass all the RFC 3986 examples.

Resolves #962

@jrflat
Copy link
Contributor Author

jrflat commented Dec 20, 2024

@swift-ci please test

@jrflat jrflat merged commit ee1a608 into swiftlang:main Dec 20, 2024
3 checks passed
jrflat added a commit to jrflat/swift-foundation that referenced this pull request Mar 5, 2025
parkera pushed a commit that referenced this pull request Mar 5, 2025
* (141549683) Restore behavior of URL(string: "") returning nil (#1103)

* (142076445) Allow URL.standardized to return an empty string URL (#1110)

* (142076445) Allow URL.standardized to return an empty string URL

* Add ?? self to prevent force-unwrap

* (142446243) Compatibility behaviors for Swift URL (#1113)

* (142589056) URLComponents.string should percent-encode colons in first path segment if needed (#1117)

* (142667792) URL.absoluteString crashes if baseURL starts with colon (#1119)

* (143159003) Don't encode colon if URLComponents path starts with colon (#1139)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

URL.init(string:) handling of empty strings has changed in Swift 6
2 participants