Skip to content
This repository has been archived by the owner on Feb 24, 2025. It is now read-only.

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