Skip to content

Consolidate URL compatibility checks #1392

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
Jun 30, 2025
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
4 changes: 2 additions & 2 deletions Sources/FoundationEssentials/URL/URL_Swift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ internal final class _SwiftURL: Sendable, Hashable, Equatable {
/// `URL("/").deletingLastPathComponent == URL("/../")`
/// `URL("/../").standardized == URL("")`
#if FOUNDATION_FRAMEWORK
if URL.compatibility4 && path == "/" {
if URL.compatibility1 && path == "/" {
components.percentEncodedPath = "/../"
} else {
components.percentEncodedPath = newPath
Expand Down Expand Up @@ -915,7 +915,7 @@ internal final class _SwiftURL: Sendable, Hashable, Equatable {
/// `URL("/../").standardized == URL("")`
#if FOUNDATION_FRAMEWORK
guard isDecomposable else { return nil }
let newPath = if URL.compatibility4 && _parseInfo.path == "/../" {
let newPath = if URL.compatibility1 && _parseInfo.path == "/../" {
""
} else {
String(_parseInfo.path).removingDotSegments
Expand Down
Loading