]> Cypherpunks repositories - gostls13.git/commit
net/url: handle escaped paths in ResolveReference
authorDave Day <djd@golang.org>
Thu, 1 Sep 2016 03:13:37 +0000 (13:13 +1000)
committerDave Day <djd@golang.org>
Thu, 8 Sep 2016 23:14:16 +0000 (23:14 +0000)
commitf27c1bda5165f94115458908b5222d992010cbee
tree580ddfccd796e1374a8df8f9fed263d074ee33bf
parent29f18d7983d9ae3752a36cf22f4c83601f6da9ea
net/url: handle escaped paths in ResolveReference

Currently, path resolution is done using the un-escaped version of
paths. This means that path elements like one%2ftwo%2fthree are
handled incorrectly, and optional encodings (%2d vs. -) are dropped.

This function makes escaped handling consistent with Parse: provided
escapings are honoured, and RawPath is only set if necessary.

A helper method setPath is introduced to handle the correct setting of
Path and RawPath given the encoded path.

Fixes #16947

Change-Id: I40b1215e9066e88ec868b41635066eee220fde37
Reviewed-on: https://go-review.googlesource.com/28343
Run-TryBot: Dave Day <djd@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/url/url.go
src/net/url/url_test.go