Skip to content

Commit

Permalink
Keep connection open by reading the body + don't leak the body
Browse files Browse the repository at this point in the history
  • Loading branch information
MaXal committed Nov 14, 2023
1 parent 2a0f368 commit 8ea3d48
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/server/meta/description.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/pkg/errors"
"github.com/sakura-internet/go-rison/v4"
"go.uber.org/zap"
"io"
"net/http"
"strings"
)
Expand Down Expand Up @@ -37,6 +38,8 @@ func CreateGetDescriptionRequestHandler(logger *zap.Logger, metaDb *pgxpool.Pool
writer.WriteHeader(http.StatusInternalServerError)
return
}
defer request.Body.Close()
_, _ = io.Copy(io.Discard, request.Body)

cacheKey := []byte(params.Project + params.Branch)
cachedValue, isInCache := cache.HasGet(nil, cacheKey)
Expand Down

0 comments on commit 8ea3d48

Please sign in to comment.