Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(219)

Issue 7205056: net/url: allow resolution of "" and "#fragment"

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 3 months ago by rodrigo.moraes
Modified:
11 years, 3 months ago
Reviewers:
adg, bradfitz
Visibility:
Public.

Description

net/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" #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -7 lines) Patch
M src/pkg/net/url/url.go View 1 1 chunk +12 lines, -0 lines 0 comments Download
M src/pkg/net/url/url_test.go View 1 2 chunks +22 lines, -7 lines 0 comments Download

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b