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
The methods provided in NSPathUtilities / NSURLPathUtilities categories adhere mostly to RFC 1808.
NSURLComponents, on the other hand, uses the more-modern RFC 3986 behavior.
My view is that continuing to expose RFC 1808–style behavior is harmful to users. Results may be unexpected:
NSURL(string: "http://one/two;three/four")!.URLByAppendingPathComponent("five")
// This returns "http://one/two/five;three/four".// Paths whose last component starts/ends with a dot (.) also have problems:leturl = NSURL(fileURLWithPath: "/path/to/.file")
// Expected: ???// Actual: ""letext = url.pathExtension!
// Expected (based on pathExtension being ""): "/path/to/.file"// Actual: "/path/to/"url.URLByDeletingPathExtension!
// Expected: same as original URL// Actual: "/path/to./"url.URLByDeletingPathExtension!.URLByAppendingPathExtension(ext)
// <rdar://18421068>, only recently resolved in El Capitan, was a similar issue in NSURLComponents.
This has produced some problems in Apple system behavior (see <rdar://23241861>), let alone latent bugs in third-party code.
These sorts of things should be hard to get wrong, rather than easy. I think the Foundation APIs could use some love here.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: bcd1290e284ffe9fda05487cde2ea447
Issue Description:
The methods provided in NSPathUtilities / NSURLPathUtilities categories adhere mostly to RFC 1808.
NSURLComponents, on the other hand, uses the more-modern RFC 3986 behavior.
My view is that continuing to expose RFC 1808–style behavior is harmful to users. Results may be unexpected:
This has produced some problems in Apple system behavior (see <rdar://23241861>), let alone latent bugs in third-party code.
These sorts of things should be hard to get wrong, rather than easy. I think the Foundation APIs could use some love here.
The text was updated successfully, but these errors were encountered: