Descriptionnet/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 #MessagesTotal messages: 11
|