Add body from basic auth plugin.

Fixes issue by adding unit test to make sure the body from
the plugin is written correctly and proxied to the client.

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis
2019-06-07 10:11:40 +01:00
parent ef811783fb
commit d6b3847fbd
2 changed files with 36 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package handlers
import (
"context"
"io"
"net/http"
"time"
)
@ -36,5 +37,9 @@ func MakeExternalAuthHandler(next http.HandlerFunc, upstreamTimeout time.Duratio
copyHeaders(w.Header(), &res.Header)
w.WriteHeader(res.StatusCode)
if res.Body != nil {
io.Copy(w, res.Body)
}
}
}