Why doesn't mailto has // after the scheme [du

2019-08-14 08:38发布

问题:

This question already has an answer here:

  • Is an email mailto link a valid URL? 1 answer

While writing a library code to generate URI strings, I got confused about mailto. According to RFC 3986 authority for a URI must be preceded by //. Authority is the part of URI where the userinfo and host resides in userinfo@host syntax. According to this RFC the format should be: mailto://me@host.com. However, it is used as mailto:me@host.com not just in the wild but also shown like that in RFC 2368 and RFC 6068.

The only way mailto being a URI is that the email is appended as path, which doesn't make much sense. Is this assumption correct or is there another point I am missing.

回答1:

It seems that mailto is a URN, even if it feels a bit strange. Thus in mailto:me@host.com, me@host.com is indeed path for URI as described in RFC 3986



标签: uri mailto