Descriptionnet/url: allow resolution of "" and "#fragment"
Currently URL.Parse("") or URL.Parse("#fragment") result in an error, but they should be correctly resolved as same-document references. This patch fixes this, allowing URL.Parse() to receive "" or "#fragment".
I'm being conservative not implementing in Parse() because this could be considered an API break, since empty strings resulted in error before. However it sounds like a bug to me and an ideal solution would be that Parse() could receive such arguments as well, so that URL.ResolveReference() could also resolve same-document references. Let me know if this sounds reasonable and I'll send a new patch.
Patch Set 1 #Patch Set 2 : net/url: allow resolution of "" and "#fragment" #
|