Monty’s Gush

Gotcha with mailto URI equality

Posted on: July 5, 2012

I thought it might be a good idea to store email addresses as URIs in one scenario. But the oddest bug in my application turned out to be caused by this decision!

> new Uri("mailto:pete@example.com") = new Uri("mailto:mary@example.com");;
val it : bool = true

 UserInfo and Fragment content is ignored when making this comparison.

The username@ part of an email address counts as user-information in the mailto scheme! Thanks, MSDN.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: