You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And since URLComponents is the only way to get a URL's percentEncodedPath, it becomes impossible to get the non-decoded path of a URL if that path contains a semicolon.
This combines with SR-15508 so creating a URLComponents can actually remove the path entirely if it contains invalid UTF-8. There's no way to read this path.
leturl = URL(string:"s:/;foo%82")!
letcomps = URLComponents(url: url, resolvingAgainstBaseURL: true)!
print(url) // "s:/;foo%82"print(url.path) // "" - this is SR-15508print(comps.string) // "s:" - the URLComponents initializer does it, too!print(comps.path) // ""print(comps.percentEncodedPath) // ""
I found some other interesting cases during fuzzing, so I'm including them here with the WebURL result (which should be what Foundation does after '.standardize' - at least for these cases, there's no WebURL-specific path normalization rules):
Environment
macOS 11.6, Xcode 13.1 (13A1030d)
Additional Detail from JIRA
md5: aaea3663eae14ba3252b1c92812396ad
Issue Description:
And since URLComponents is the only way to get a URL's percentEncodedPath, it becomes impossible to get the non-decoded path of a URL if that path contains a semicolon.
This combines with SR-15508 so creating a URLComponents can actually remove the path entirely if it contains invalid UTF-8. There's no way to read this path.
I found some other interesting cases during fuzzing, so I'm including them here with the WebURL result (which should be what Foundation does after '.standardize' - at least for these cases, there's no WebURL-specific path normalization rules):
The text was updated successfully, but these errors were encountered: