-[NSURLComponents URL] does not correctly translate paths with semicolons

Originator:jtbandes
Number:rdar://18421068 Date Originated:2014/09/22
Status:Closed Resolved:2015/06/21
Product:macOS SDK Product Version:
Classification: Reproducible:
 
We believe this issue has been addressed in the latest OS X v10.11 Developer beta.  This is a pre-release OS X v10.11 update.

Please refer to the release notes for complete installation instructions.

Please test with this release.  If you still have issues, please include any relevant logs or information that could help us investigate.

OS X El Capitan
https://developer.apple.com/osx/download/




Summary:
The NSURLComponents header states:

"Although ';' is a legal path character, it is recommended that it be percent-encoded for best compatibility with NSURL (-stringByAddingPercentEncodingWithAllowedCharacters: will percent-encode any ';' characters if you pass the URLPathAllowedCharacterSet)."

However, NSURLComponents's own translation to NSURL does not behave correctly.

Steps to Reproduce:
Try the following code:

NSURLComponents *components = [NSURLComponents componentsWithString:@"http://one/two;three/four"];
NSLog(@"Path: %@", [components path]);
NSLog(@"Percent-encoded path: %@", [components path]);
NSLog(@"URL path: %@", [[components URL] path]);

Expected Results:
Path: /two;three/four
Percent-encoded path: /two;three/four —(or /two%3Bthree/four)
URL path: /two;three/four

Actual Results:
Path: /two;three/four
Percent-encoded path: /two;three/four
URL path: /two

Version:
Xcode 6 Beta 2
OS X 10.10 (14A361c)

Notes:
Workaround is to re-encode the percentEncodedPath.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!