• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSURL bug with IPv6 addresses
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSURL bug with IPv6 addresses
      • From: "Kyle Sluder" <email@hidden>
  • Prev by Date: Re: "Live" image preview, huge memory usage...
  • Next by Date: Re: Viewing Documentation in Safari
  • Previous by thread: Re: Creating a Bottom Bar on NSWindow
  • Next by thread: Re: NSURL bug with IPv6 addresses
  • Index(es):
    • Date
    • Thread