Skip to content

Commit

Permalink
trick traefik
Browse files Browse the repository at this point in the history
  • Loading branch information
1lann committed Jan 5, 2024
1 parent bbeef50 commit 38bee54
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mini.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ func NewMini(config MiniConfig, next CaddyHandleFunc) (*Tmpauth, error) {
}

transport := &MiniTransport{
base: http.DefaultTransport,
tmpauth: t,
RoundTripper: http.DefaultTransport,
tmpauth: t,
}

t.miniClient = &http.Client{
Expand Down Expand Up @@ -157,7 +157,7 @@ func (t *Tmpauth) ReauthMini() error {
}

type MiniTransport struct {
base http.RoundTripper
http.RoundTripper
tmpauth *Tmpauth
}

Expand All @@ -181,7 +181,7 @@ func (t *MiniTransport) RoundTrip(req *http.Request) (*http.Response, error) {

req.Body = io.NopCloser(bytes.NewReader(body))

resp, err := t.base.RoundTrip(req)
resp, err := t.RoundTripper.RoundTrip(req)
if resp.StatusCode == http.StatusPreconditionFailed {
// our config ID is wrong
err := t.tmpauth.ReauthMini()
Expand Down

0 comments on commit 38bee54

Please sign in to comment.