diff options
author | Matthew Holt <[email protected]> | 2020-04-09 13:22:05 -0600 |
---|---|---|
committer | Matthew Holt <[email protected]> | 2020-04-09 13:22:05 -0600 |
commit | f29023bf8f7de84faf0db8233b0c4b3b4ce74e93 (patch) | |
tree | 51a90c5ccf4b86a3a2329740b9737a63474ec4fa | |
parent | 85f5f47f31f09f8dda6f6ab77749edddb17551a1 (diff) | |
download | caddy-2.0.0-rc.2.tar.gz caddy-2.0.0-rc.2.zip |
reverseproxy: Minor tweaksv2.0.0-rc.2
We'll need that context in v2.1 when the transport can manage its own
client certificates; see #3198
-rw-r--r-- | modules/caddyhttp/reverseproxy/command.go | 2 | ||||
-rw-r--r-- | modules/caddyhttp/reverseproxy/httptransport.go | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/caddyhttp/reverseproxy/command.go b/modules/caddyhttp/reverseproxy/command.go index cde30845c..c20312607 100644 --- a/modules/caddyhttp/reverseproxy/command.go +++ b/modules/caddyhttp/reverseproxy/command.go @@ -121,7 +121,7 @@ func cmdReverseProxy(fs caddycmd.Flags) (int, error) { urlHost := fromURL.Hostname() if urlHost != "" { route.MatcherSetsRaw = []caddy.ModuleMap{ - caddy.ModuleMap{ + { "host": caddyconfig.JSON(caddyhttp.MatchHost{urlHost}, nil), }, } diff --git a/modules/caddyhttp/reverseproxy/httptransport.go b/modules/caddyhttp/reverseproxy/httptransport.go index c0d9c8d27..4b5111c0a 100644 --- a/modules/caddyhttp/reverseproxy/httptransport.go +++ b/modules/caddyhttp/reverseproxy/httptransport.go @@ -99,12 +99,12 @@ func (HTTPTransport) CaddyModule() caddy.ModuleInfo { // Provision sets up h.Transport with a *http.Transport // that is ready to use. -func (h *HTTPTransport) Provision(_ caddy.Context) error { +func (h *HTTPTransport) Provision(ctx caddy.Context) error { if len(h.Versions) == 0 { h.Versions = []string{"1.1", "2"} } - rt, err := h.NewTransport() + rt, err := h.NewTransport(ctx) if err != nil { return err } @@ -115,7 +115,7 @@ func (h *HTTPTransport) Provision(_ caddy.Context) error { // NewTransport builds a standard-lib-compatible // http.Transport value from h. -func (h *HTTPTransport) NewTransport() (*http.Transport, error) { +func (h *HTTPTransport) NewTransport(_ caddy.Context) (*http.Transport, error) { dialer := &net.Dialer{ Timeout: time.Duration(h.DialTimeout), FallbackDelay: time.Duration(h.FallbackDelay), |