close request bodies
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
@@ -196,6 +196,9 @@ func (k Konnectd) Index() http.HandlerFunc {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
k.logger.Fatal().Err(err).Msg("Could not read index template")
|
k.logger.Fatal().Err(err).Msg("Could not read index template")
|
||||||
}
|
}
|
||||||
|
if err = f.Close(); err != nil {
|
||||||
|
k.logger.Fatal().Err(err).Msg("Could not close body")
|
||||||
|
}
|
||||||
|
|
||||||
// TODO add environment variable to make the path prefix configurable
|
// TODO add environment variable to make the path prefix configurable
|
||||||
pp := "/signin/v1"
|
pp := "/signin/v1"
|
||||||
|
|||||||
@@ -137,6 +137,10 @@ func (o Ocs) RemoveFromGroup(w http.ResponseWriter, r *http.Request) {
|
|||||||
render.Render(w, r, response.ErrRender(data.MetaBadRequest.StatusCode, err.Error()))
|
render.Render(w, r, response.ErrRender(data.MetaBadRequest.StatusCode, err.Error()))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if err = r.Body.Close(); err != nil {
|
||||||
|
render.Render(w, r, response.ErrRender(data.MetaServerError.StatusCode, err.Error()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
values, err := url.ParseQuery(string(body))
|
values, err := url.ParseQuery(string(body))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -145,6 +145,9 @@ func TestProxyIntegration(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal("Error reading result body")
|
t.Fatal("Error reading result body")
|
||||||
}
|
}
|
||||||
|
if err = rr.Result().Body.Close(); err != nil {
|
||||||
|
t.Fatal("Error closing result body")
|
||||||
|
}
|
||||||
|
|
||||||
bodyString := string(resultBody)
|
bodyString := string(resultBody)
|
||||||
if bodyString != `OK` {
|
if bodyString != `OK` {
|
||||||
|
|||||||
Reference in New Issue
Block a user