Skip to content
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

Fix site: queries escaping with iOS 17 SDK (#640) #640

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions Sources/Common/Extensions/URLExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,21 +158,16 @@ extension URL {
s = scheme.separated() + s.dropFirst(scheme.separated().count - 1)
}

#if os(macOS)
let url: URL?
let urlWithScheme: URL?
if #available(macOS 14.0, *) {
if #available(macOS 14.0, iOS 17.0, *) {
// Making sure string is strictly valid according to the RFC
url = URL(string: s, encodingInvalidCharacters: false)
urlWithScheme = URL(string: NavigationalScheme.http.separated() + s, encodingInvalidCharacters: false)
} else {
url = URL(string: s)
urlWithScheme = URL(string: NavigationalScheme.http.separated() + s)
}
#else
let url = URL(string: s)
let urlWithScheme = URL(string: NavigationalScheme.http.separated() + s)
#endif

if let url {
// if URL has domain:port or user:password@domain mistakengly interpreted as a scheme
Expand Down
Loading