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

Issue 7203059: code review 7203059: net/url: better path resolution (Closed)

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

Description

net/url: better path resolution This includes a simplified resolvePath function and tests for all normal and abnormal path resolution examples described in RFC 3986, sections 5.4.1 and 5.4.2 [1]. Some of those examples failed before (see http://play.golang.org/p/F0ApSaXniv). Also, parsing a reference "//foo" now works as expected. It was treated as an absolute path with very weird results (see http://play.golang.org/p/089b-_xoNe). During path resolution, all dot segments are removed as described by the RFC. A few existing tests had to be changed because they expected the wrong output. Fixes issue 4700. Fixes issue 4706. [1] http://tools.ietf.org/html/rfc3986#section-5.4.1

Patch Set 1 #

Patch Set 2 : net/url: better path resolution #

Patch Set 3 : Cleaner URL.ResolveReference. #

Patch Set 4 : Now removes dot segments from *all* paths resulted from ResolveReference, and always make them star… #

Patch Set 5 : Also included fix for issue #4700. #

Patch Set 6 : diff -r 58e1987657d6 https://code.google.com/p/go #

Total comments: 39

Patch Set 7 : diff -r e2f9b9a58240 https://code.google.com/p/go #

Patch Set 8 : diff -r e2f9b9a58240 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+150 lines, -150 lines) Patch
M src/pkg/net/url/url.go View 1 2 3 4 5 6 7 3 chunks +48 lines, -56 lines 0 comments Download
M src/pkg/net/url/url_test.go View 1 2 3 4 5 6 7 3 chunks +102 lines, -94 lines 0 comments Download

Messages

Total messages: 11
rsc
This CL was not created using the standard hg code review tools. Please do that.
11 years, 3 months ago (2013-01-31 17:11:43 UTC) #1
rodrigo.moraes
Hello rsc@golang.org, adg@golang.org, bradfitz@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
11 years, 3 months ago (2013-01-31 17:38:21 UTC) #2
rodrigo.moraes
On 2013/01/31 17:11:43, rsc wrote: > This CL was not created using the standard hg ...
11 years, 3 months ago (2013-01-31 17:58:32 UTC) #3
adg
https://codereview.appspot.com/7203059/diff/14001/src/pkg/net/url/url.go File src/pkg/net/url/url.go (right): https://codereview.appspot.com/7203059/diff/14001/src/pkg/net/url/url.go#newcode598 src/pkg/net/url/url.go:598: return base return "" (just to be really explicit) ...
11 years, 3 months ago (2013-02-04 01:33:40 UTC) #4
rsc
Please add tests for the cases I asked about below, assuming we can figure out ...
11 years, 3 months ago (2013-02-04 04:45:40 UTC) #5
rodrigo.moraes
Hello rsc@golang.org, adg@golang.org, bradfitz@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 3 months ago (2013-02-04 11:12:26 UTC) #6
rodrigo.moraes
Applied all suggestions. Please take another look. https://codereview.appspot.com/7203059/diff/14001/src/pkg/net/url/url.go File src/pkg/net/url/url.go (right): https://codereview.appspot.com/7203059/diff/14001/src/pkg/net/url/url.go#newcode328 src/pkg/net/url/url.go:328: // Special ...
11 years, 3 months ago (2013-02-04 11:12:53 UTC) #7
rodrigo.moraes
Two notes: - It seems that TestResolveReferenceOpaque isn't testing anything different that is not covered ...
11 years, 3 months ago (2013-02-04 12:56:43 UTC) #8
rodrigo.moraes
Hello rsc@golang.org, adg@golang.org, bradfitz@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 3 months ago (2013-02-04 17:22:33 UTC) #9
rsc
LGTM Sorry for the delay.
11 years, 2 months ago (2013-03-11 19:02:42 UTC) #10
rsc
11 years, 2 months ago (2013-03-11 19:03:21 UTC) #11
*** Submitted as https://code.google.com/p/go/source/detail?r=c890576b82a1 ***

net/url: better path resolution

This includes a simplified resolvePath function and tests for all normal and
abnormal path resolution examples described in RFC 3986, sections 5.4.1 and
5.4.2 [1]. Some of those examples failed before (see
http://play.golang.org/p/F0ApSaXniv).

Also, parsing a reference "//foo" now works as expected. It was treated as an
absolute path with very weird results (see http://play.golang.org/p/089b-_xoNe).

During path resolution, all dot segments are removed as described by the RFC.

A few existing tests had to be changed because they expected the wrong output.

Fixes issue 4700.

Fixes issue 4706.

[1] http://tools.ietf.org/html/rfc3986#section-5.4.1

R=rsc, adg, bradfitz
CC=golang-dev
https://codereview.appspot.com/7203059

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

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