diff --git a/mini.go b/mini.go index d126f95..a30a497 100644 --- a/mini.go +++ b/mini.go @@ -118,14 +118,16 @@ func NewMini(config MiniConfig, next CaddyHandleFunc) (*Tmpauth, error) { doneOnce: sync.Once{}, } + transport := &MiniTransport{ + base: http.DefaultTransport, + tmpauth: t, + } + t.miniClient = &http.Client{ CheckRedirect: func(req *http.Request, via []*http.Request) error { return http.ErrUseLastResponse }, - Transport: &MiniTransport{ - base: http.DefaultTransport, - tmpauth: t, - }, + Transport: transport, } return t, nil