Adjust forward auth to avoid connection leak
This commit is contained in:
parent
561c580701
commit
3216c8ab10
1 changed files with 1 additions and 1 deletions
|
@ -126,6 +126,7 @@ func (fa *forwardAuth) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
||||||
rw.WriteHeader(http.StatusInternalServerError)
|
rw.WriteHeader(http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
defer forwardResponse.Body.Close()
|
||||||
|
|
||||||
body, readError := io.ReadAll(forwardResponse.Body)
|
body, readError := io.ReadAll(forwardResponse.Body)
|
||||||
if readError != nil {
|
if readError != nil {
|
||||||
|
@ -136,7 +137,6 @@ func (fa *forwardAuth) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
||||||
rw.WriteHeader(http.StatusInternalServerError)
|
rw.WriteHeader(http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer forwardResponse.Body.Close()
|
|
||||||
|
|
||||||
// Pass the forward response's body and selected headers if it
|
// Pass the forward response's body and selected headers if it
|
||||||
// didn't return a response within the range of [200, 300).
|
// didn't return a response within the range of [200, 300).
|
||||||
|
|
Loading…
Reference in a new issue