2 files changed
@@ -22,6 +22,7 @@ import ( | |||
| 22 | 22 | "net/http/httptrace" | |
| 23 | 23 | "net/textproto" | |
| 24 | 24 | "net/url" | |
| 25 | + urlpkg "net/url" | ||
| 25 | 26 | "strconv" | |
| 26 | 27 | "strings" | |
| 27 | 28 | "sync" | |
@@ -850,7 +851,7 @@ func NewRequestWithContext(ctx context.Context, method, url string, body io.Read | |||
| 850 | 851 | if ctx == nil { | |
| 851 | 852 | return nil, errors.New("net/http: nil Context") | |
| 852 | 853 | } | |
| 853 | - u, err := parseURL(url) // Just url.Parse (url is shadowed for godoc). | ||
| 854 | + u, err := urlpkg.Parse(url) | ||
| 854 | 855 | if err != nil { | |
| 855 | 856 | return nil, err | |
| 856 | 857 | } | |
@@ -19,6 +19,7 @@ import ( | |||
| 19 | 19 | "net" | |
| 20 | 20 | "net/textproto" | |
| 21 | 21 | "net/url" | |
| 22 | + urlpkg "net/url" | ||
| 22 | 23 | "os" | |
| 23 | 24 | "path" | |
| 24 | 25 | "runtime" | |
@@ -2065,8 +2066,7 @@ func StripPrefix(prefix string, h Handler) Handler { | |||
| 2065 | 2066 | // Setting the Content-Type header to any value, including nil, | |
| 2066 | 2067 | // disables that behavior. | |
| 2067 | 2068 | func Redirect(w ResponseWriter, r *Request, url string, code int) { | |
| 2068 | - // parseURL is just url.Parse (url is shadowed for godoc). | ||
| 2069 | - if u, err := parseURL(url); err == nil { | ||
| 2069 | + if u, err := urlpkg.Parse(url); err == nil { | ||
| 2070 | 2070 | // If url was relative, make its path absolute by | |
| 2071 | 2071 | // combining with request path. | |
| 2072 | 2072 | // The client would probably do this for us, | |
@@ -2120,10 +2120,6 @@ func Redirect(w ResponseWriter, r *Request, url string, code int) { | |||
| 2120 | 2120 | } | |
| 2121 | 2121 | } | |
| 2122 | 2122 | ||
| 2123 | - // parseURL is just url.Parse. It exists only so that url.Parse can be called | ||
| 2124 | - // in places where url is shadowed for godoc. See https://golang.org/cl/49930. | ||
| 2125 | - var parseURL = url.Parse | ||
| 2126 | - | ||
| 2127 | 2123 | var htmlReplacer = strings.NewReplacer( | |
| 2128 | 2124 | "&", "&", | |
| 2129 | 2125 | "<", "<", | |
0 commit comments