aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/http/reverseproxy.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2011-08-17 13:36:02 +1000
committerRob Pike <r@golang.org>2011-08-17 13:36:02 +1000
commit1d8f822c170891ac72e85020178c27aded27c644 (patch)
treeffe1889bd493631230b81af12d5efc8569ce6517 /src/pkg/http/reverseproxy.go
parentd72c96df2a4f9b1b6b83cd7be55b4e53ac3a3c9c (diff)
downloadgo-1d8f822c170891ac72e85020178c27aded27c644.tar.xz
url: new package
This is just moving the URL code from package http into its own package, which has been planned for a while. Besides clarity, this also breaks a nascent dependency cycle the new template package was about to introduce. Add a gofix module, url, and use it to generate changes outside http and url. Sadness about the churn, gladness about some of the naming improvements. R=dsymonds, bradfitz, rsc, gustavo, r CC=golang-dev https://golang.org/cl/4893043
Diffstat (limited to 'src/pkg/http/reverseproxy.go')
-rw-r--r--src/pkg/http/reverseproxy.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkg/http/reverseproxy.go b/src/pkg/http/reverseproxy.go
index 015f87f246..3f8bfdc80c 100644
--- a/src/pkg/http/reverseproxy.go
+++ b/src/pkg/http/reverseproxy.go
@@ -14,6 +14,7 @@ import (
"strings"
"sync"
"time"
+ "url"
)
// ReverseProxy is an HTTP Handler that takes an incoming request and
@@ -53,7 +54,7 @@ func singleJoiningSlash(a, b string) string {
// URLs to the scheme, host, and base path provided in target. If the
// target's path is "/base" and the incoming request was for "/dir",
// the target request will be for /base/dir.
-func NewSingleHostReverseProxy(target *URL) *ReverseProxy {
+func NewSingleHostReverseProxy(target *url.URL) *ReverseProxy {
director := func(req *Request) {
req.URL.Scheme = target.Scheme
req.URL.Host = target.Host