NSURL(string:relativeTo:) does not properly construct URLs
||Product Version:||Xcode 8.2.1|
The last path component of the relative URL is always stripped when using this initializer.
Steps to Reproduce:
1. Launch `swift`
2. > import Foundation
3. > NSURL(string: "foo", relativeTo:URL(string:"http://base.com/foo/bar")!)!.absoluteString
$R1: String? = "http://base.com/foo/bar/foo"
$R1: String? = "http://base.com/foo/foo"
Xcode Version 8.2.1 (8C1002)
MacOS 10.12.4 (16E195)
This affects the Objective-C API as well, since it is bridged.
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!