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

Issue 14654045: code review 14654045: net/url: Fix regression from issue 11698045:

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by raff
Modified:
10 years, 4 months ago
Reviewers:
minux1, dave, golang-codereviews
Visibility:
Public.

Description

net/url: Fix regression from issue 11698045: I belive the current fix is not 100% correct (or at least it breaks a use case that used to work before the fix). The following test used to return "a/b/c" and now it returns "/a/b/c" (i.e. a relative URL becomes absolute): func main() { path := "a/b/c" u, _ := url.Parse(path) fmt.Println("path:", path) fmt.Println("url:", u) } I understand the root problem but I think the correct fix should be to also check that the buffer is not empty (i.e. if I do create a URL with schema/host and a relative path I DO WANT the "/", but if the URL only has the Path set, it should be left alone). Also, I don't see any test for this particular use case The fix only prepend a "/" if the buffer is not empty (i.e. it should have scheme:host). Also reworked the test case (added a new TestURLToString test and added a list of urltostringtests, for now containing only the two cases involved with this issue)

Patch Set 1 #

Patch Set 2 : diff -r 1d23464b2d2f https://code.google.com/p/go #

Patch Set 3 : diff -r 1d23464b2d2f https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -19 lines) Patch
M src/pkg/net/url/url.go View 1 1 chunk +5 lines, -3 lines 0 comments Download
M src/pkg/net/url/url_test.go View 1 3 chunks +41 lines, -16 lines 0 comments Download

Messages

Total messages: 6
raff
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
10 years, 6 months ago (2013-10-17 04:56:24 UTC) #1
dave_cheney.net
Did you raise an issue for this regression ? On Thu, Oct 17, 2013 at ...
10 years, 6 months ago (2013-10-17 05:01:06 UTC) #2
dave_cheney.net
ping! go 1.2 is very close to shipping.
10 years, 5 months ago (2013-11-02 07:04:21 UTC) #3
minux1
This issue has already been fixed by https://codereview.appspot.com/14815043.
10 years, 5 months ago (2013-11-02 07:23:06 UTC) #4
gobot
Replacing golang-dev with golang-codereviews.
10 years, 4 months ago (2013-12-20 16:26:03 UTC) #5
dave_cheney.net
10 years, 4 months ago (2013-12-20 21:26:22 UTC) #6
On 2013/12/20 16:26:03, gobot wrote:
> Replacing golang-dev with golang-codereviews.

R=close
Sign in to reply to this message.

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