perf: further optimize http and body buffer handling

This commit is contained in:
yusing
2025-10-12 20:57:51 +08:00
parent eef994082c
commit c66de99fcb
9 changed files with 97 additions and 42 deletions

View File

@@ -92,7 +92,7 @@ func (m *forwardAuthMiddleware) before(w http.ResponseWriter, r *http.Request) (
if resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusMultipleChoices {
body, release, err := httputils.ReadAllBody(resp)
defer release()
defer release(body)
if err != nil {
ForwardAuth.LogError(r).Err(err).Msg("failed to read response body")