NSURL bug with IPv6 addresses
NSURL bug with IPv6 addresses
- Subject: NSURL bug with IPv6 addresses
- From: Larry Campbell <email@hidden>
- Date: Tue, 02 Dec 2008 22:59:30 -0500
This snippet:
url = [[[NSURL alloc] initWithString:@"http://
[2001:4860:0:2001::68]/"] autorelease];
NSLog(@"url host=\"%@\", absolute string=\"%@\"", [url host],
[url absoluteString]);
url = [[[NSURL alloc] initWithScheme:@"http"
host:@"2001:4860:0:2001::68" path:@"/"] autorelease];
NSLog(@"url host=\"%@\", absolute string=\"%@\"", [url host],
[url absoluteString]);
url = [[[NSURL alloc] initWithScheme:@"http"
host:@"[2001:4860:0:2001::68]" path:@"/"] autorelease];
NSLog(@"url host=\"%@\", absolute string=\"%@\"", [url host],
[url absoluteString]);
produces this output:
2008-12-02 22:56:20.641 NSURLBug[17834:817] url
host="2001:4860:0:2001::68", absolute string="http://
[2001:4860:0:2001::68]/"
2008-12-02 22:56:20.644 NSURLBug[17834:817] url host="2001", absolute
string="http://2001:4860:0:2001::68//"
2008-12-02 22:56:20.657 NSURLBug[17834:817] url host="[2001", absolute
string="http://[2001:4860:0:2001::68]//"
The first line is the correct, desired result; the next two are
totally borked. So is this just known to be broken? Or is there some
way to get it to work?
- lc
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden